Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/resources/inspector-protocol-test.js

Issue 2960023003: [DevTools] Migrate inspector-protocol/emulation tests to new harness (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/resources/device-scale-not-persistant.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)}`);
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/resources/device-scale-not-persistant.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698