OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 /** | 6 /** |
7 * @fileoverview This file contains small testing framework along with the | 7 * @fileoverview This file contains small testing framework along with the |
8 * test suite for the frontend. These tests are a part of the continues build | 8 * test suite for the frontend. These tests are a part of the continues build |
9 * and are executed by the devtools_sanity_unittest.cc as a part of the | 9 * and are executed by the devtools_sanity_unittest.cc as a part of the |
10 * Interactive UI Test suite. | 10 * Interactive UI Test suite. |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 var png = false; | 255 var png = false; |
256 var html = false; | 256 var html = false; |
257 this.addSniffer(WebInspector, 'updateResource', | 257 this.addSniffer(WebInspector, 'updateResource', |
258 function(identifier, payload) { | 258 function(identifier, payload) { |
259 if (!payload.didLengthChange) | 259 if (!payload.didLengthChange) |
260 return; | 260 return; |
261 var resource = WebInspector.resources[identifier]; | 261 var resource = WebInspector.resources[identifier]; |
262 if (!resource || !resource.url) | 262 if (!resource || !resource.url) |
263 return; | 263 return; |
264 if (resource.url.search('image.html$') != -1) { | 264 if (resource.url.search('image.html$') != -1) { |
265 var expectedLength = 93; | 265 var expectedLength = 87; |
266 test.assertTrue( | 266 test.assertTrue( |
267 resource.contentLength <= expectedLength, | 267 resource.contentLength <= expectedLength, |
268 'image.html content length is greater thatn expected.'); | 268 'image.html content length is greater thatn expected.'); |
269 if (expectedLength == resource.contentLength) { | 269 if (expectedLength == resource.contentLength) { |
270 html = true; | 270 html = true; |
271 } | 271 } |
272 } else if (resource.url.search('image.png') != -1) { | 272 } else if (resource.url.search('image.png') != -1) { |
273 var expectedLength = 257796; | 273 var expectedLength = 257796; |
274 test.assertTrue( | 274 test.assertTrue( |
275 resource.contentLength <= expectedLength, | 275 resource.contentLength <= expectedLength, |
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 /** | 1753 /** |
1754 * Run specified test on a fresh instance of the test suite. | 1754 * Run specified test on a fresh instance of the test suite. |
1755 * @param {string} name Name of a test method from TestSuite class. | 1755 * @param {string} name Name of a test method from TestSuite class. |
1756 */ | 1756 */ |
1757 uiTests.runTest = function(name) { | 1757 uiTests.runTest = function(name) { |
1758 new TestSuite().runTest(name); | 1758 new TestSuite().runTest(name); |
1759 }; | 1759 }; |
1760 | 1760 |
1761 | 1761 |
1762 } | 1762 } |
OLD | NEW |