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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 var initialize_BindingsTest = function() {
2
3 InspectorTest.preloadModule("sources");
4
5 InspectorTest.dumpWorkspace = function() {
6 var uiSourceCodes = Workspace.workspace.uiSourceCodes().slice();
7 var urls = uiSourceCodes.map(code => code.url());
8 urls = urls.map(url => {
9 if (!url.startsWith('debugger://'))
10 return url;
11 return url.replace(/VM\d+/g, 'VM[XXX]');
12 });
13
14 urls.sort(String.caseInsensetiveComparator);
15 InspectorTest.addResult(`Workspace: ${urls.length} uiSourceCodes.`);
16 for (var url of urls) {
17 InspectorTest.addResult(' ' + url);
18 }
19 }
20
21 InspectorTest.attachFrame = function(frameId, url, evalSourceURL) {
22 var evalSource = `(${attachFrame.toString()})('${frameId}', '${url}')`;
23 if (evalSourceURL)
24 evalSource += '//# sourceURL=' + evalSourceURL;
25 return InspectorTest.evaluateInPageAsync(evalSource);
26
27 function attachFrame(frameId, url) {
28 var frame = document.createElement('iframe');
29 frame.src = url;
30 frame.id = frameId;
31 document.body.appendChild(frame);
32 return new Promise(x => frame.onload = x);
33 }
34 }
35
36 InspectorTest.detachFrame = function(frameId, evalSourceURL) {
37 var evalSource = `(${detachFrame.toString()})('${frameId}')`;
38 if (evalSourceURL)
39 evalSource += '//# sourceURL=' + evalSourceURL;
40 return InspectorTest.evaluateInPagePromise(evalSource);
41
42 function detachFrame(frameId) {
43 var frame = document.getElementById(frameId);
44 frame.remove();
45 }
46 }
47
48 InspectorTest.navigateFrame = function(frameId, navigateURL, evalSourceURL) {
49 var evalSource = `(${navigateFrame.toString()})('${frameId}', '${navigateURL }')`;
50 if (evalSourceURL)
51 evalSource += '//# sourceURL=' + evalSourceURL;
52 return InspectorTest.evaluateInPageAsync(evalSource);
53
54 function navigateFrame(frameId, url) {
55 var frame = document.getElementById(frameId);
56 frame.src = url;
57 return new Promise(x => frame.onload = x);
58 }
59 }
60
61 InspectorTest.markStep = function(title) {
62 InspectorTest.addResult('\nRunning: ' + title);
63 }
64
65 }
66
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698