| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 if (!chrome || !chrome.test) | 5 if (!chrome || !chrome.test) |
| 6 throw new Error('chrome.test is undefined'); | 6 throw new Error('chrome.test is undefined'); |
| 7 | 7 |
| 8 var portNumber; | 8 var portNumber; |
| 9 | 9 |
| 10 // This is a good end-to-end test for two reasons. The first is obvious - it | 10 // This is a good end-to-end test for two reasons. The first is obvious - it |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 chrome.test.assertTrue(!!results, 'results'); | 108 chrome.test.assertTrue(!!results, 'results'); |
| 109 chrome.test.assertEq(1, results.length); | 109 chrome.test.assertEq(1, results.length); |
| 110 chrome.test.assertEq('new title', results[0]); | 110 chrome.test.assertEq('new title', results[0]); |
| 111 chrome.tabs.get(tab.id, tab => { | 111 chrome.tabs.get(tab.id, tab => { |
| 112 chrome.test.assertEq('new title', tab.title); | 112 chrome.test.assertEq('new title', tab.title); |
| 113 chrome.test.succeed(); | 113 chrome.test.succeed(); |
| 114 }); | 114 }); |
| 115 }); | 115 }); |
| 116 }); | 116 }); |
| 117 }, | 117 }, |
| 118 function testLastError() { |
| 119 chrome.runtime.setUninstallURL('chrome://newtab', function() { |
| 120 chrome.test.assertLastError('Invalid URL: "chrome://newtab".'); |
| 121 chrome.test.succeed(); |
| 122 }); |
| 123 }, |
| 118 ]; | 124 ]; |
| 119 | 125 |
| 120 chrome.test.getConfig(config => { | 126 chrome.test.getConfig(config => { |
| 121 chrome.test.assertTrue(!!config, 'config does not exist'); | 127 chrome.test.assertTrue(!!config, 'config does not exist'); |
| 122 chrome.test.assertTrue(!!config.testServer, 'testServer does not exist'); | 128 chrome.test.assertTrue(!!config.testServer, 'testServer does not exist'); |
| 123 portNumber = config.testServer.port; | 129 portNumber = config.testServer.port; |
| 124 chrome.test.runTests(tests); | 130 chrome.test.runTests(tests); |
| 125 }); | 131 }); |
| OLD | NEW |