OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 allTests = [ | 5 var allTests = [ |
6 function testCloseTab() { | 6 function testCloseTab() { |
7 getUrlFromConfig(function(url) { | 7 getUrlFromConfig('index.html', function(url) { |
8 chrome.tabs.create({'url': url}, function(tab) { | 8 chrome.tabs.create({'url': url}, function(tab) { |
9 chrome.automation.getTree(function(rootNode) { | 9 chrome.automation.getTree(function(rootNode) { |
10 rootNode.addEventListener(EventType.destroyed, function() { | 10 rootNode.addEventListener(EventType.destroyed, function() { |
11 // Should get a 'destroyed' event when the tab is closed. | 11 // Should get a 'destroyed' event when the tab is closed. |
12 // TODO(aboxhall): assert actual cleanup has occurred once | 12 // TODO(aboxhall): assert actual cleanup has occurred once |
13 // crbug.com/387954 makes it possible. | 13 // crbug.com/387954 makes it possible. |
14 chrome.test.succeed(); | 14 chrome.test.succeed(); |
15 }); | 15 }); |
16 chrome.tabs.remove(tab.id); | 16 chrome.tabs.remove(tab.id); |
17 }); | 17 }); |
18 }); | 18 }); |
19 }); | 19 }); |
20 } | 20 } |
21 ] | 21 ] |
22 chrome.test.runTests(allTests); | 22 chrome.test.runTests(allTests); |
OLD | NEW |