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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/automation/tests/tabs/tab_id.js
diff --git a/chrome/test/data/extensions/api_test/automation/tests/tabs/tab_id.js b/chrome/test/data/extensions/api_test/automation/tests/tabs/tab_id.js
new file mode 100644
index 0000000000000000000000000000000000000000..97b9b487e456036f860cf951440fb8a4bfc2c134
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/automation/tests/tabs/tab_id.js
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var allTests = [
+ function testGetTabById() {
+ chrome.tabs.query({ active: true }, function(tabs) {
+ chrome.test.assertEq(1, tabs.length);
+ var newTabPageTab = tabs[0];
+ getUrlFromConfig(function(url) {
+ createTab(url, function(tab) {
+ // make the NTP the active tab so that we know we're requesting the
+ // tab by ID rather than just getting the active tab still.
+ chrome.tabs.update(newTabPageTab.id, { active: true }, function() {
+ chrome.automation.getTree(tab.id, function(tree) {
+ tree.addEventListener('loadComplete', function() {
+ var title = tree.root.attributes['docTitle'];
+ chrome.test.assertEq('Automation Tests', title);
+ chrome.test.succeed();
+ });
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).
+ })
+ });
+ });
+ });
+ });
+ }
+];
+
+chrome.test.runTests(allTests);

Powered by Google App Engine
This is Rietveld 408576698