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

Unified Diff: chrome/test/data/extensions/api_test/tabs/basics/duplicate.js

Issue 10697017: Tabs Extension: Implementation of tabs.duplicate api. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « chrome/test/data/extensions/api_test/tabs/basics/duplicate.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/tabs/basics/duplicate.js
===================================================================
--- chrome/test/data/extensions/api_test/tabs/basics/duplicate.js (revision 0)
+++ chrome/test/data/extensions/api_test/tabs/basics/duplicate.js (revision 0)
@@ -0,0 +1,32 @@
+// Copyright (c) 2011 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 firstTabId;
+var firstWindowId;
+
+chrome.test.runTests([
+ function setupWindow() {
+ createWindow([pageUrl("a")], {},
+ pass(function(winId, tabIds) {
+ firstWindowId = winId;
+ firstTabId = tabIds[0];
+ }));
+ },
+
+ function duplicateTab() {
+ chrome.tabs.duplicate(firstTabId, pass(function(tab) {
+ assertEq(pageUrl("a"), tab.url);
+ assertEq(1, tab.index);
+ }));
+ },
+
+ function totalTab() {
+ chrome.tabs.getAllInWindow(firstWindowId,
+ pass(function(tabs) {
+ assertEq(tabs.length, 2);
+ assertEq(tabs[0].url, tabs[1].url);
+ assertEq(tabs[0].index + 1, tabs[1].index);
+ }));
+ }
+]);
« no previous file with comments | « chrome/test/data/extensions/api_test/tabs/basics/duplicate.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698