| Index: third_party/WebKit/LayoutTests/inspector-protocol/resources/inspector-protocol-test.js
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/resources/inspector-protocol-test.js b/third_party/WebKit/LayoutTests/inspector-protocol/resources/inspector-protocol-test.js
|
| index 5530d828bbfbf4e0f8e5e6145d8e77b079f8100c..ca431062fb82e66fbdbae98a91461ff5e2801162 100644
|
| --- a/third_party/WebKit/LayoutTests/inspector-protocol/resources/inspector-protocol-test.js
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/resources/inspector-protocol-test.js
|
| @@ -199,20 +199,7 @@ TestRunner.Page = class {
|
| this._testRunner.die(`Cannot navigate to ${url} with active session`, new Error());
|
|
|
| var session = await this.createSession();
|
| - session.protocol.Page.enable();
|
| - session.protocol.Page.navigate({url: url});
|
| -
|
| - var callback;
|
| - var promise = new Promise(f => callback = f);
|
| - session.protocol.Page.onFrameNavigated(message => {
|
| - if (!message.params.frame.parentId)
|
| - callback();
|
| - });
|
| - await Promise.all([
|
| - promise,
|
| - session.protocol.Page.onceLoadEventFired()
|
| - ]);
|
| -
|
| + await session._navigate(url);
|
| await session.disconnect();
|
| }
|
|
|
| @@ -279,6 +266,26 @@ TestRunner.Session = class {
|
| }
|
| }
|
|
|
| + navigate(url) {
|
| + return this._navigate(this._testRunner.url(url));
|
| + }
|
| +
|
| + async _navigate(url) {
|
| + this.protocol.Page.enable();
|
| + this.protocol.Page.navigate({url: url});
|
| +
|
| + var callback;
|
| + var promise = new Promise(f => callback = f);
|
| + this.protocol.Page.onFrameNavigated(message => {
|
| + if (!message.params.frame.parentId)
|
| + callback();
|
| + });
|
| + await Promise.all([
|
| + promise,
|
| + this.protocol.Page.onceLoadEventFired()
|
| + ]);
|
| + }
|
| +
|
| _dispatchMessage(message) {
|
| if (this._testRunner._dumpInspectorProtocolMessages)
|
| this._testRunner.log(`backend => frontend: ${JSON.stringify(message)}`);
|
|
|