Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 var allTests = [ | |
| 6 function testGetTabById() { | |
| 7 chrome.tabs.query({ active: true }, function(tabs) { | |
| 8 chrome.test.assertEq(1, tabs.length); | |
| 9 var newTabPageTab = tabs[0]; | |
| 10 getUrlFromConfig(function(url) { | |
| 11 createTab(url, function(tab) { | |
| 12 // make the NTP the active tab so that we know we're requesting the | |
| 13 // tab by ID rather than just getting the active tab still. | |
| 14 chrome.tabs.update(newTabPageTab.id, { active: true }, function() { | |
| 15 chrome.automation.getTree(tab.id, function(tree) { | |
|
David Tseng
2014/05/29 22:41:31
This almost makes me want named object parameters
aboxhall
2014/05/30 15:37:11
What other named parameters might we want? I'm def
| |
| 16 var title = tree.root.attributes['docTitle']; | |
|
David Tseng
2014/05/29 22:41:31
nit: attributes.docTitle
| |
| 17 chrome.test.assertEq('Automation Tests', title); | |
| 18 chrome.test.succeed(); | |
| 19 }); | |
| 20 }); | |
| 21 }); | |
| 22 }); | |
| 23 }); | |
| 24 } | |
| 25 ]; | |
| 26 | |
| 27 chrome.test.runTests(allTests); | |
| OLD | NEW |