OLD | NEW |
---|---|
1 <!-- | 1 <!-- |
2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
4 found in the LICENSE file. | 4 found in the LICENSE file. |
5 --> | 5 --> |
6 | 6 |
7 <link rel="import" href="../../lib/network-simulator.html"> | 7 <link rel="import" href="../../lib/network-simulator.html"> |
8 | 8 |
9 <script> | 9 <script> |
10 (function() { | 10 (function() { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 simulator.probe = function(url) { | 70 simulator.probe = function(url) { |
71 probedURLs.push(url); | 71 probedURLs.push(url); |
72 if (url.endsWith('.txt')) | 72 if (url.endsWith('.txt')) |
73 return Promise.resolve(); | 73 return Promise.resolve(); |
74 else if (/taco.+png$/.test(url)) | 74 else if (/taco.+png$/.test(url)) |
75 return Promise.resolve(); | 75 return Promise.resolve(); |
76 else | 76 else |
77 return Promise.reject(); | 77 return Promise.reject(); |
78 }; | 78 }; |
79 simulator.runTest(function() { | 79 simulator.runTest(function() { |
80 results.fetchResultsURLs({ | 80 return Promise.resolve().then(function() { |
81 'builderName': 'Mock Builder', | 81 return results.fetchResultsURLs({ |
Jeffrey Yasskin
2014/09/03 22:11:50
The only changes here are the extra "}).then(funct
| |
82 'testName': 'userscripts/another-test.html', | 82 'builderName': 'Mock Builder', |
83 'failureTypeList': ['IMAGE', 'CRASH'], | 83 'testName': 'userscripts/another-test.html', |
84 }).then(function(resultURLs) { | 84 'failureTypeList': ['IMAGE', 'CRASH'], |
85 assert.deepEqual(resultURLs, [ | 85 }).then(function(resultURLs) { |
86 MockResultsBaseURL + '/userscripts/another-test-crash-log.txt' | 86 assert.deepEqual(resultURLs, [ |
87 ]); | 87 MockResultsBaseURL + '/userscripts/another-test-crash-log.txt' |
88 }); | 88 ]); |
89 results.fetchResultsURLs({ | 89 }); |
90 'builderName': 'Mock Builder', | 90 }).then(function() { |
91 'testName': 'userscripts/another-test.html', | 91 return results.fetchResultsURLs({ |
92 'failureTypeList': ['TIMEOUT'], | 92 'builderName': 'Mock Builder', |
93 }).then(function(resultURLs) { | 93 'testName': 'userscripts/another-test.html', |
94 assert.deepEqual(resultURLs, []); | 94 'failureTypeList': ['TIMEOUT'], |
95 }); | 95 }).then(function(resultURLs) { |
96 results.fetchResultsURLs({ | 96 assert.deepEqual(resultURLs, []); |
97 'builderName': 'Mock Builder', | 97 }); |
98 'testName': 'userscripts/taco.html', | 98 }).then(function() { |
99 'failureTypeList': ['IMAGE', 'IMAGE+TEXT'], | 99 return results.fetchResultsURLs({ |
100 }).then(function(resultURLs) { | 100 'builderName': 'Mock Builder', |
101 assert.deepEqual(resultURLs, [ | 101 'testName': 'userscripts/taco.html', |
102 'failureTypeList': ['IMAGE', 'IMAGE+TEXT'], | |
103 }).then(function(resultURLs) { | |
104 assert.deepEqual(resultURLs, [ | |
105 MockResultsBaseURL + '/userscripts/taco-expected.png', | |
106 MockResultsBaseURL + '/userscripts/taco-actual.png', | |
107 MockResultsBaseURL + '/userscripts/taco-diff.png', | |
108 MockResultsBaseURL + '/userscripts/taco-expected.txt', | |
109 MockResultsBaseURL + '/userscripts/taco-actual.txt', | |
110 MockResultsBaseURL + '/userscripts/taco-diff.txt', | |
111 ]); | |
112 }); | |
113 }).then(function() { | |
114 return results.fetchResultsURLs({ | |
115 'builderName': 'Mock Builder', | |
116 'testName': 'userscripts/another-test.html', | |
117 'failureTypeList': ['LEAK'], | |
118 }).then(function(resultURLs) { | |
119 assert.deepEqual(resultURLs, [ | |
120 MockResultsBaseURL + '/userscripts/another-test-leak-log.txt' | |
121 ]); | |
122 }); | |
123 }).then(function() { | |
124 assert.deepEqual(probedURLs, [ | |
125 MockResultsBaseURL + '/userscripts/another-test-expected.png', | |
126 MockResultsBaseURL + '/userscripts/another-test-actual.png', | |
127 MockResultsBaseURL + '/userscripts/another-test-diff.png', | |
128 MockResultsBaseURL + '/userscripts/another-test-crash-log.txt', | |
102 MockResultsBaseURL + '/userscripts/taco-expected.png', | 129 MockResultsBaseURL + '/userscripts/taco-expected.png', |
103 MockResultsBaseURL + '/userscripts/taco-actual.png', | 130 MockResultsBaseURL + '/userscripts/taco-actual.png', |
104 MockResultsBaseURL + '/userscripts/taco-diff.png', | 131 MockResultsBaseURL + '/userscripts/taco-diff.png', |
132 MockResultsBaseURL + '/userscripts/taco-actual.txt', | |
105 MockResultsBaseURL + '/userscripts/taco-expected.txt', | 133 MockResultsBaseURL + '/userscripts/taco-expected.txt', |
106 MockResultsBaseURL + '/userscripts/taco-actual.txt', | |
107 MockResultsBaseURL + '/userscripts/taco-diff.txt', | 134 MockResultsBaseURL + '/userscripts/taco-diff.txt', |
135 MockResultsBaseURL + '/userscripts/another-test-leak-log.txt', | |
108 ]); | 136 ]); |
109 }); | 137 }); |
110 results.fetchResultsURLs({ | |
111 'builderName': 'Mock Builder', | |
112 'testName': 'userscripts/another-test.html', | |
113 'failureTypeList': ['LEAK'], | |
114 }).then(function(resultURLs) { | |
115 assert.deepEqual(resultURLs, [ | |
116 MockResultsBaseURL + '/userscripts/another-test-leak-log.txt' | |
117 ]); | |
118 }); | |
119 }).then(function() { | |
120 assert.deepEqual(probedURLs, [ | |
121 MockResultsBaseURL + '/userscripts/another-test-expected.png', | |
122 MockResultsBaseURL + '/userscripts/another-test-actual.png', | |
123 MockResultsBaseURL + '/userscripts/another-test-diff.png', | |
124 MockResultsBaseURL + '/userscripts/another-test-crash-log.txt', | |
125 MockResultsBaseURL + '/userscripts/taco-expected.png', | |
126 MockResultsBaseURL + '/userscripts/taco-actual.png', | |
127 MockResultsBaseURL + '/userscripts/taco-diff.png', | |
128 MockResultsBaseURL + '/userscripts/taco-actual.txt', | |
129 MockResultsBaseURL + '/userscripts/taco-expected.txt', | |
130 MockResultsBaseURL + '/userscripts/taco-diff.txt', | |
131 MockResultsBaseURL + '/userscripts/another-test-leak-log.txt', | |
132 ]); | |
133 done(); | |
134 }); | 138 }); |
135 }); | 139 }); |
136 }); | 140 }); |
137 | 141 |
138 })(); | 142 })(); |
139 </script> | 143 </script> |
OLD | NEW |