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

Side by Side 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, 4 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 (c) 2011 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 firstTabId;
6 var firstWindowId;
7
8 chrome.test.runTests([
9 function setupWindow() {
10 createWindow([pageUrl("a")], {},
11 pass(function(winId, tabIds) {
12 firstWindowId = winId;
13 firstTabId = tabIds[0];
14 }));
15 },
16
17 function duplicateTab() {
18 chrome.tabs.duplicate(firstTabId, pass(function(tab) {
19 assertEq(pageUrl("a"), tab.url);
20 assertEq(1, tab.index);
21 }));
22 },
23
24 function totalTab() {
25 chrome.tabs.getAllInWindow(firstWindowId,
26 pass(function(tabs) {
27 assertEq(tabs.length, 2);
28 assertEq(tabs[0].url, tabs[1].url);
29 assertEq(tabs[0].index + 1, tabs[1].index);
30 }));
31 }
32 ]);
33 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
34 // Use of this source code is governed by a BSD-style license that can be
35 // found in the LICENSE file.
36
37 var firstTabId;
38 var firstWindowId;
39
40 chrome.test.runTests([
41 function setupWindow() {
42 createWindow([pageUrl("a")], {},
43 pass(function(winId, tabIds) {
44 firstWindowId = winId;
45 firstTabId = tabIds[0];
46 }));
47 },
48
49 function duplicateTab() {
50 chrome.tabs.duplicate(firstTabId, pass(function(tab) {
51 assertEq(pageUrl("a"), tab.url);
52 assertEq(1, tab.index);
53 }));
54 },
55
56 function totalTab() {
57 chrome.tabs.getAllInWindow(firstWindowId,
58 pass(function(tabs) {
59 assertEq(tabs.length, 2);
60 assertEq(tabs[0].url, tabs[1].url);
61 assertEq(tabs[0].index + 1, tabs[1].index);
62 }));
63 }
64 ]);
65 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
66 // Use of this source code is governed by a BSD-style license that can be
67 // found in the LICENSE file.
68
69 var firstTabId;
70 var firstWindowId;
71
72 chrome.test.runTests([
73 function setupWindow() {
74 createWindow([pageUrl("a")], {},
75 pass(function(winId, tabIds) {
76 firstWindowId = winId;
77 firstTabId = tabIds[0];
78 }));
79 },
80
81 function duplicateTab() {
82 chrome.tabs.duplicate(firstTabId, pass(function(tab) {
83 assertEq(pageUrl("a"), tab.url);
84 assertEq(1, tab.index);
85 }));
86 },
87
88 function totalTab() {
89 chrome.tabs.getAllInWindow(firstWindowId,
90 pass(function(tabs) {
91 assertEq(tabs.length, 2);
92 assertEq(tabs[0].url, tabs[1].url);
93 assertEq(tabs[0].index + 1, tabs[1].index);
94 }));
95 }
96 ]);
97 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
98 // Use of this source code is governed by a BSD-style license that can be
99 // found in the LICENSE file.
100
101 var firstTabId;
102 var firstWindowId;
103
104 chrome.test.runTests([
105 function setupWindow() {
106 createWindow([pageUrl("a")], {},
107 pass(function(winId, tabIds) {
108 firstWindowId = winId;
109 firstTabId = tabIds[0];
110 }));
111 },
112
113 function duplicateTab() {
114 chrome.tabs.duplicate(firstTabId, pass(function(tab) {
115 assertEq(pageUrl("a"), tab.url);
116 assertEq(1, tab.index);
117 }));
118 },
119
120 function totalTab() {
121 chrome.tabs.getAllInWindow(firstWindowId,
122 pass(function(tabs) {
123 assertEq(tabs.length, 2);
124 assertEq(tabs[0].url, tabs[1].url);
125 assertEq(tabs[0].index + 1, tabs[1].index);
126 }));
127 }
128 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698