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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js

Issue 2735933002: DevTools: add tests to fixate bindings behavior (Closed)
Patch Set: DevTools: add tests to fixate bindings behavior Created 3 years, 9 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
Index: third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
new file mode 100644
index 0000000000000000000000000000000000000000..47dc100dd1332283e18a3d22ed6073a44d513816
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/bindings/bindings-test.js
@@ -0,0 +1,66 @@
+var initialize_BindingsTest = function() {
+
+InspectorTest.preloadModule("sources");
+
+InspectorTest.dumpWorkspace = function() {
+ var uiSourceCodes = Workspace.workspace.uiSourceCodes().slice();
+ var urls = uiSourceCodes.map(code => code.url());
+ urls = urls.map(url => {
+ if (!url.startsWith('debugger://'))
+ return url;
+ return url.replace(/VM\d+/g, 'VM[XXX]');
+ });
+
+ urls.sort(String.caseInsensetiveComparator);
+ InspectorTest.addResult(`Workspace: ${urls.length} uiSourceCodes.`);
+ for (var url of urls) {
+ InspectorTest.addResult(' ' + url);
+ }
+}
+
+InspectorTest.attachFrame = function(frameId, url, evalSourceURL) {
+ var evalSource = `(${attachFrame.toString()})('${frameId}', '${url}')`;
+ if (evalSourceURL)
+ evalSource += '//# sourceURL=' + evalSourceURL;
+ return InspectorTest.evaluateInPageAsync(evalSource);
+
+ function attachFrame(frameId, url) {
+ var frame = document.createElement('iframe');
+ frame.src = url;
+ frame.id = frameId;
+ document.body.appendChild(frame);
+ return new Promise(x => frame.onload = x);
+ }
+}
+
+InspectorTest.detachFrame = function(frameId, evalSourceURL) {
+ var evalSource = `(${detachFrame.toString()})('${frameId}')`;
+ if (evalSourceURL)
+ evalSource += '//# sourceURL=' + evalSourceURL;
+ return InspectorTest.evaluateInPagePromise(evalSource);
+
+ function detachFrame(frameId) {
+ var frame = document.getElementById(frameId);
+ frame.remove();
+ }
+}
+
+InspectorTest.navigateFrame = function(frameId, navigateURL, evalSourceURL) {
+ var evalSource = `(${navigateFrame.toString()})('${frameId}', '${navigateURL}')`;
+ if (evalSourceURL)
+ evalSource += '//# sourceURL=' + evalSourceURL;
+ return InspectorTest.evaluateInPageAsync(evalSource);
+
+ function navigateFrame(frameId, url) {
+ var frame = document.getElementById(frameId);
+ frame.src = url;
+ return new Promise(x => frame.onload = x);
+ }
+}
+
+InspectorTest.markStep = function(title) {
+ InspectorTest.addResult('\nRunning: ' + title);
+}
+
+}
+

Powered by Google App Engine
This is Rietveld 408576698