OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // extension_apitest.js | 5 // extension_apitest.js |
6 // mini-framework for ExtensionApiTest browser tests | 6 // mini-framework for ExtensionApiTest browser tests |
7 | 7 |
8 chrome.test = chrome.test || {}; | 8 chrome.test = chrome.test || {}; |
9 | 9 |
10 chrome.test.tests = chrome.test.tests || []; | 10 chrome.test.tests = chrome.test.tests || []; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 chrome.test.fail = function(message) { | 82 chrome.test.fail = function(message) { |
83 chrome.test.log("( FAILED ) " + testName(currentTest)); | 83 chrome.test.log("( FAILED ) " + testName(currentTest)); |
84 | 84 |
85 var stack = {}; | 85 var stack = {}; |
86 Error.captureStackTrace(stack, chrome.test.fail); | 86 Error.captureStackTrace(stack, chrome.test.fail); |
87 | 87 |
88 if (!message) | 88 if (!message) |
89 message = "FAIL (no message)"; | 89 message = "FAIL (no message)"; |
90 | 90 |
91 message += "\n" + stack.stack; | 91 message += "\n" + stack.stack; |
92 console.log("[FAIL] " + testName(currentTest) + ": " + message); | 92 chrome.test.log("[FAIL] " + testName(currentTest) + ": " + message); |
pneubeck (no reviews)
2013/03/04 10:44:38
also a leftover for debuggin...
| |
93 testsFailed++; | 93 testsFailed++; |
94 testDone(); | 94 testDone(); |
95 | 95 |
96 // Interrupt the rest of the test. | 96 // Interrupt the rest of the test. |
97 throw failureException; | 97 throw failureException; |
98 }; | 98 }; |
99 | 99 |
100 chrome.test.succeed = function() { | 100 chrome.test.succeed = function() { |
101 console.log("[SUCCESS] " + testName(currentTest)); | 101 console.log("[SUCCESS] " + testName(currentTest)); |
102 chrome.test.log("( SUCCESS )"); | 102 chrome.test.log("( SUCCESS )"); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 | 265 |
266 chrome.test.callbackFail = function(expectedError, func) { | 266 chrome.test.callbackFail = function(expectedError, func) { |
267 return chrome.test.callback(func, expectedError); | 267 return chrome.test.callback(func, expectedError); |
268 }; | 268 }; |
269 | 269 |
270 chrome.test.runTests = function(tests) { | 270 chrome.test.runTests = function(tests) { |
271 chrome.test.tests = tests; | 271 chrome.test.tests = tests; |
272 testCount = chrome.test.tests.length; | 272 testCount = chrome.test.tests.length; |
273 chrome.test.runNextTest(); | 273 chrome.test.runNextTest(); |
274 }; | 274 }; |
OLD | NEW |