OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 var embedder = {}; | 5 var embedder = {}; |
6 embedder.tests = {}; | 6 embedder.tests = {}; |
7 embedder.baseGuestURL = ''; | 7 embedder.baseGuestURL = ''; |
8 embedder.guestURL = ''; | 8 embedder.guestURL = ''; |
9 | 9 |
10 window.runTest = function(testName) { | 10 window.runTest = function(testName) { |
(...skipping 23 matching lines...) Expand all Loading... |
34 var html = | 34 var html = |
35 'data:text/html,' + | 35 'data:text/html,' + |
36 '<html><head><title>%s</title></head>' + | 36 '<html><head><title>%s</title></head>' + |
37 '<body>hello world</body>' + | 37 '<body>hello world</body>' + |
38 '</html>'; | 38 '</html>'; |
39 return html.replace('%s', title); | 39 return html.replace('%s', title); |
40 }; | 40 }; |
41 | 41 |
42 embedder.test = {}; | 42 embedder.test = {}; |
43 embedder.test.succeed = function() { | 43 embedder.test.succeed = function() { |
44 chrome.test.sendMessage('DoneDialogTest.PASSED'); | 44 chrome.test.sendMessage('TEST_PASSED'); |
45 }; | 45 }; |
46 | 46 |
47 embedder.test.fail = function() { | 47 embedder.test.fail = function() { |
48 chrome.test.sendMessage('DoneDialogTest.FAILED'); | 48 chrome.test.sendMessage('TEST_FAILED'); |
49 }; | 49 }; |
50 | 50 |
51 embedder.test.assertEq = function(a, b) { | 51 embedder.test.assertEq = function(a, b) { |
52 if (a != b) { | 52 if (a != b) { |
53 console.log('assertion failed: ' + a + ' != ' + b); | 53 console.log('assertion failed: ' + a + ' != ' + b); |
54 embedder.test.fail(); | 54 embedder.test.fail(); |
55 } | 55 } |
56 }; | 56 }; |
57 | 57 |
58 embedder.test.assertTrue = function(condition) { | 58 embedder.test.assertTrue = function(condition) { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 'testConfirmDialogDefaultGCCancel': testConfirmDialogDefaultGCCancel, | 293 'testConfirmDialogDefaultGCCancel': testConfirmDialogDefaultGCCancel, |
294 'testConfirmDialogCancel': testConfirmDialogCancel, | 294 'testConfirmDialogCancel': testConfirmDialogCancel, |
295 'testPromptDialog': testPromptDialog | 295 'testPromptDialog': testPromptDialog |
296 }; | 296 }; |
297 | 297 |
298 onload = function() { | 298 onload = function() { |
299 chrome.test.getConfig(function(config) { | 299 chrome.test.getConfig(function(config) { |
300 chrome.test.sendMessage('Launched'); | 300 chrome.test.sendMessage('Launched'); |
301 }); | 301 }); |
302 }; | 302 }; |
OLD | NEW |