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

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

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

Powered by Google App Engine
This is Rietveld 408576698