Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(557)

Side by Side Diff: chrome/test/data/extensions/api_test/automation/tests/tabs/tab_id.js

Issue 308003003: Allow requesting Automation tree by tabId (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary content script from tests Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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) {
16 tree.addEventListener('loadComplete', function() {
17 var title = tree.root.attributes['docTitle'];
18 chrome.test.assertEq('Automation Tests', title);
19 chrome.test.succeed();
20 });
not at google - send to devlin 2014/05/29 22:41:37 impressive you should really be wrapping these ca
aboxhall 2014/05/30 15:37:11 How do you mean functions I could pull this stuff
aboxhall 2014/05/30 16:09:16 Done (after offline discussion).
21 })
22 });
23 });
24 });
25 });
26 }
27 ];
28
29 chrome.test.runTests(allTests);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698