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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/uisourcecode-revisions.html

Issue 1363993007: DevTools: remove UISourceCode.networkURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script> 3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script src="../http/tests/inspector/sources-test.js"></script> 4 <script src="../http/tests/inspector/sources-test.js"></script>
5 <script> 5 <script>
6 function test() 6 function test()
7 { 7 {
8 function createMockProject() 8 function createMockProject()
9 { 9 {
10 var workspace = new WebInspector.Workspace(); 10 var workspace = new WebInspector.Workspace();
(...skipping 24 matching lines...) Expand all
35 revisionsString += ", "; 35 revisionsString += ", ";
36 revisionsString += "'" + revision.content + "'"; 36 revisionsString += "'" + revision.content + "'";
37 } 37 }
38 InspectorTest.addResult("UISourceCode content: " + content); 38 InspectorTest.addResult("UISourceCode content: " + content);
39 InspectorTest.addResult(" revisions: " + revisionsString); 39 InspectorTest.addResult(" revisions: " + revisionsString);
40 } 40 }
41 41
42 InspectorTest.runTestSuite([ 42 InspectorTest.runTestSuite([
43 function testAddRevisionsRevertToOriginal(next) 43 function testAddRevisionsRevertToOriginal(next)
44 { 44 {
45 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri", "originURL", "url", WebInspector.resourceTypes.Script); 45 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri", "originURL", WebInspector.resourceTypes.Script);
46 uiSourceCode.setWorkingCopy("content1"); 46 uiSourceCode.setWorkingCopy("content1");
47 uiSourceCode.setWorkingCopy("content2"); 47 uiSourceCode.setWorkingCopy("content2");
48 uiSourceCode.commitWorkingCopy(function() { }); 48 uiSourceCode.commitWorkingCopy(function() { });
49 49
50 InspectorTest.addResult("First revision added."); 50 InspectorTest.addResult("First revision added.");
51 dumpUISourceCodeWithRevisions(uiSourceCode); 51 dumpUISourceCodeWithRevisions(uiSourceCode);
52 uiSourceCode.setWorkingCopy("content3"); 52 uiSourceCode.setWorkingCopy("content3");
53 uiSourceCode.setWorkingCopy("content4"); 53 uiSourceCode.setWorkingCopy("content4");
54 uiSourceCode.commitWorkingCopy(function() { }); 54 uiSourceCode.commitWorkingCopy(function() { });
55 55
56 InspectorTest.addResult("Second revision added."); 56 InspectorTest.addResult("Second revision added.");
57 dumpUISourceCodeWithRevisions(uiSourceCode); 57 dumpUISourceCodeWithRevisions(uiSourceCode);
58 uiSourceCode.revertToOriginal(); 58 uiSourceCode.revertToOriginal();
59 InspectorTest.addResult("Reverted to original."); 59 InspectorTest.addResult("Reverted to original.");
60 dumpUISourceCodeWithRevisions(uiSourceCode); 60 dumpUISourceCodeWithRevisions(uiSourceCode);
61 next(); 61 next();
62 }, 62 },
63 63
64 function testAddRevisionsRevertAndClearHistory(next) 64 function testAddRevisionsRevertAndClearHistory(next)
65 { 65 {
66 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri2", "originURL2", "url2", WebInspector.resourceTypes.Script); 66 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri2", "originURL2", WebInspector.resourceTypes.Script);
67 67
68 uiSourceCode.setWorkingCopy("content1"); 68 uiSourceCode.setWorkingCopy("content1");
69 uiSourceCode.setWorkingCopy("content2"); 69 uiSourceCode.setWorkingCopy("content2");
70 uiSourceCode.commitWorkingCopy(function() { }); 70 uiSourceCode.commitWorkingCopy(function() { });
71 71
72 InspectorTest.addResult("First revision added."); 72 InspectorTest.addResult("First revision added.");
73 dumpUISourceCodeWithRevisions(uiSourceCode); 73 dumpUISourceCodeWithRevisions(uiSourceCode);
74 uiSourceCode.setWorkingCopy("content3"); 74 uiSourceCode.setWorkingCopy("content3");
75 uiSourceCode.setWorkingCopy("content4"); 75 uiSourceCode.setWorkingCopy("content4");
76 uiSourceCode.commitWorkingCopy(function() { }); 76 uiSourceCode.commitWorkingCopy(function() { });
77 77
78 InspectorTest.addResult("Second revision added."); 78 InspectorTest.addResult("Second revision added.");
79 dumpUISourceCodeWithRevisions(uiSourceCode); 79 dumpUISourceCodeWithRevisions(uiSourceCode);
80 uiSourceCode.revertAndClearHistory(revertedAndClearedHistory); 80 uiSourceCode.revertAndClearHistory(revertedAndClearedHistory);
81 81
82 function revertedAndClearedHistory() 82 function revertedAndClearedHistory()
83 { 83 {
84 InspectorTest.addResult("Reverted and cleared history."); 84 InspectorTest.addResult("Reverted and cleared history.");
85 dumpUISourceCodeWithRevisions(uiSourceCode); 85 dumpUISourceCodeWithRevisions(uiSourceCode);
86 next(); 86 next();
87 } 87 }
88 }, 88 },
89 89
90 function testAddRevisionsRevertToPrevious(next) 90 function testAddRevisionsRevertToPrevious(next)
91 { 91 {
92 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri3", "originURL3", "url3", WebInspector.resourceTypes.Script); 92 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri3", "originURL3", WebInspector.resourceTypes.Script);
93 93
94 uiSourceCode.setWorkingCopy("content1"); 94 uiSourceCode.setWorkingCopy("content1");
95 uiSourceCode.setWorkingCopy("content2"); 95 uiSourceCode.setWorkingCopy("content2");
96 uiSourceCode.commitWorkingCopy(function() { }); 96 uiSourceCode.commitWorkingCopy(function() { });
97 97
98 InspectorTest.addResult("First revision added."); 98 InspectorTest.addResult("First revision added.");
99 dumpUISourceCodeWithRevisions(uiSourceCode); 99 dumpUISourceCodeWithRevisions(uiSourceCode);
100 uiSourceCode.setWorkingCopy("content3"); 100 uiSourceCode.setWorkingCopy("content3");
101 uiSourceCode.setWorkingCopy("content4"); 101 uiSourceCode.setWorkingCopy("content4");
102 uiSourceCode.commitWorkingCopy(function() { }); 102 uiSourceCode.commitWorkingCopy(function() { });
103 103
104 InspectorTest.addResult("Second revision added."); 104 InspectorTest.addResult("Second revision added.");
105 dumpUISourceCodeWithRevisions(uiSourceCode); 105 dumpUISourceCodeWithRevisions(uiSourceCode);
106 uiSourceCode.history[0].revertToThis(); 106 uiSourceCode.history[0].revertToThis();
107 InspectorTest.addResult("Reverted to previous revision."); 107 InspectorTest.addResult("Reverted to previous revision.");
108 dumpUISourceCodeWithRevisions(uiSourceCode); 108 dumpUISourceCodeWithRevisions(uiSourceCode);
109 next(); 109 next();
110 }, 110 },
111 111
112 function testRequestContentAddRevisionsRevertToOriginal(next) 112 function testRequestContentAddRevisionsRevertToOriginal(next)
113 { 113 {
114 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri4", "originURL4", "url4", WebInspector.resourceTypes.Script); 114 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri4", "originURL4", WebInspector.resourceTypes.Script);
115 uiSourceCode.requestContent(contentReceived); 115 uiSourceCode.requestContent(contentReceived);
116 116
117 function contentReceived() 117 function contentReceived()
118 { 118 {
119 InspectorTest.addResult("Content requested."); 119 InspectorTest.addResult("Content requested.");
120 dumpUISourceCodeWithRevisions(uiSourceCode); 120 dumpUISourceCodeWithRevisions(uiSourceCode);
121 uiSourceCode.setWorkingCopy("content1"); 121 uiSourceCode.setWorkingCopy("content1");
122 uiSourceCode.setWorkingCopy("content2"); 122 uiSourceCode.setWorkingCopy("content2");
123 uiSourceCode.commitWorkingCopy(function() { }); 123 uiSourceCode.commitWorkingCopy(function() { });
124 124
125 InspectorTest.addResult("First revision added."); 125 InspectorTest.addResult("First revision added.");
126 dumpUISourceCodeWithRevisions(uiSourceCode); 126 dumpUISourceCodeWithRevisions(uiSourceCode);
127 uiSourceCode.setWorkingCopy("content3"); 127 uiSourceCode.setWorkingCopy("content3");
128 uiSourceCode.setWorkingCopy("content4"); 128 uiSourceCode.setWorkingCopy("content4");
129 uiSourceCode.commitWorkingCopy(function() { }); 129 uiSourceCode.commitWorkingCopy(function() { });
130 130
131 InspectorTest.addResult("Second revision added."); 131 InspectorTest.addResult("Second revision added.");
132 dumpUISourceCodeWithRevisions(uiSourceCode); 132 dumpUISourceCodeWithRevisions(uiSourceCode);
133 uiSourceCode.revertToOriginal(); 133 uiSourceCode.revertToOriginal();
134 InspectorTest.addResult("Reverted to original."); 134 InspectorTest.addResult("Reverted to original.");
135 dumpUISourceCodeWithRevisions(uiSourceCode); 135 dumpUISourceCodeWithRevisions(uiSourceCode);
136 next(); 136 next();
137 } 137 }
138 }, 138 },
139 139
140 function testRequestContentAddRevisionsRevertAndClearHistory(next) 140 function testRequestContentAddRevisionsRevertAndClearHistory(next)
141 { 141 {
142 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri5", "originURL5", "url5", WebInspector.resourceTypes.Script); 142 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri5", "originURL5", WebInspector.resourceTypes.Script);
143 uiSourceCode.requestContent(contentReceived); 143 uiSourceCode.requestContent(contentReceived);
144 144
145 function contentReceived() 145 function contentReceived()
146 { 146 {
147 InspectorTest.addResult("Content requested."); 147 InspectorTest.addResult("Content requested.");
148 dumpUISourceCodeWithRevisions(uiSourceCode); 148 dumpUISourceCodeWithRevisions(uiSourceCode);
149 uiSourceCode.setWorkingCopy("content1"); 149 uiSourceCode.setWorkingCopy("content1");
150 uiSourceCode.setWorkingCopy("content2"); 150 uiSourceCode.setWorkingCopy("content2");
151 uiSourceCode.commitWorkingCopy(function() { }); 151 uiSourceCode.commitWorkingCopy(function() { });
152 152
(...skipping 11 matching lines...) Expand all
164 { 164 {
165 InspectorTest.addResult("Reverted and cleared history."); 165 InspectorTest.addResult("Reverted and cleared history.");
166 dumpUISourceCodeWithRevisions(uiSourceCode); 166 dumpUISourceCodeWithRevisions(uiSourceCode);
167 next(); 167 next();
168 } 168 }
169 } 169 }
170 }, 170 },
171 171
172 function testRequestContentAddRevisionsRevertToPrevious(next) 172 function testRequestContentAddRevisionsRevertToPrevious(next)
173 { 173 {
174 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri6", "originURL6", "url6", WebInspector.resourceTypes.Script); 174 var uiSourceCode = new WebInspector.UISourceCode(createMockProject() , "", "uri6", "originURL6", WebInspector.resourceTypes.Script);
175 uiSourceCode.requestContent(contentReceived); 175 uiSourceCode.requestContent(contentReceived);
176 176
177 function contentReceived() 177 function contentReceived()
178 { 178 {
179 InspectorTest.addResult("Content requested."); 179 InspectorTest.addResult("Content requested.");
180 dumpUISourceCodeWithRevisions(uiSourceCode); 180 dumpUISourceCodeWithRevisions(uiSourceCode);
181 uiSourceCode.setWorkingCopy("content1"); 181 uiSourceCode.setWorkingCopy("content1");
182 uiSourceCode.setWorkingCopy("content2"); 182 uiSourceCode.setWorkingCopy("content2");
183 uiSourceCode.commitWorkingCopy(function() { }); 183 uiSourceCode.commitWorkingCopy(function() { });
184 184
(...skipping 13 matching lines...) Expand all
198 }, 198 },
199 ]); 199 ]);
200 } 200 }
201 </script> 201 </script>
202 </head> 202 </head>
203 <body onload="runTest()"> 203 <body onload="runTest()">
204 <p>Tests revision support in UISourceCode.</p> 204 <p>Tests revision support in UISourceCode.</p>
205 <a href="https://bugs.webkit.org/show_bug.cgi?id=97669">Bug 97669</a> 205 <a href="https://bugs.webkit.org/show_bug.cgi?id=97669">Bug 97669</a>
206 </body> 206 </body>
207 </html> 207 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698