fix(Navigation): wait for lifecycle events for the frame subtree (#1356)

Currently, we wait only for the main frame to reach the desired
lifecycle state.

This patch starts waiting until all the frames reach the desired
lifecycle state.

Fixes #1173.
This commit is contained in:
Andrey Lushnikov 2017-11-10 15:44:14 -08:00 committed by GitHub
parent f8d19e79e7
commit 2c8f658815
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,10 @@ class NavigatorWatcher {
if (!frame._lifecycleEvents.has(event))
return false;
}
for (const child of frame.childFrames()) {
if (!checkLifecycle(child, expectedLifecycle))
return false;
}
return true;
}
}