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

Side by Side Diff: chrome/browser/extensions/extension_tabs_test.cc

Issue 10544023: Moving the tabs_module API into a separate directory in api/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Correcting the order of includes. Created 8 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 #include "chrome/browser/extensions/extension_tabs_module.h"
6
7 #include <string>
8
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/stringprintf.h"
12 #include "base/string_util.h"
13 #include "base/values.h"
14 #include "chrome/browser/extensions/extension_function_test_utils.h"
15 #include "chrome/browser/extensions/extension_tabs_module_constants.h"
16 #include "chrome/browser/extensions/extension_tab_util.h"
17 #include "chrome/browser/prefs/incognito_mode_prefs.h"
18 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/ui/browser.h"
20 #include "chrome/browser/ui/browser_window.h"
21 #include "chrome/test/base/in_process_browser_test.h"
22 #include "chrome/test/base/ui_test_utils.h"
23 #include "ui/gfx/rect.h"
24
25 namespace keys = extension_tabs_module_constants;
26 namespace utils = extension_function_test_utils;
27
28 namespace {
29
30 class ExtensionTabsTest : public InProcessBrowserTest {
31 };
32 }
33
34 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetWindow) {
35 int window_id = ExtensionTabUtil::GetWindowId(browser());
36
37 // Invalid window ID error.
38 EXPECT_TRUE(MatchPattern(
39 utils::RunFunctionAndReturnError(
40 new GetWindowFunction(),
41 base::StringPrintf("[%u]", window_id + 1),
42 browser()),
43 keys::kWindowNotFoundError));
44
45 // Basic window details.
46 gfx::Rect bounds;
47 if (browser()->window()->IsMinimized())
48 bounds = browser()->window()->GetRestoredBounds();
49 else
50 bounds = browser()->window()->GetBounds();
51
52 scoped_ptr<base::DictionaryValue> result(utils::ToDictionary(
53 utils::RunFunctionAndReturnResult(
54 new GetWindowFunction(),
55 base::StringPrintf("[%u]", window_id),
56 browser())));
57 EXPECT_EQ(window_id, utils::GetInteger(result.get(), "id"));
58 EXPECT_FALSE(utils::GetBoolean(result.get(), "incognito"));
59 EXPECT_EQ("normal", utils::GetString(result.get(), "type"));
60 EXPECT_EQ(bounds.x(), utils::GetInteger(result.get(), "left"));
61 EXPECT_EQ(bounds.y(), utils::GetInteger(result.get(), "top"));
62 EXPECT_EQ(bounds.width(), utils::GetInteger(result.get(), "width"));
63 EXPECT_EQ(bounds.height(), utils::GetInteger(result.get(), "height"));
64
65 // With "populate" enabled.
66 result.reset(utils::ToDictionary(
67 utils::RunFunctionAndReturnResult(
68 new GetWindowFunction(),
69 base::StringPrintf("[%u, {\"populate\": true}]", window_id),
70 browser())));
71
72 EXPECT_EQ(window_id, utils::GetInteger(result.get(), "id"));
73 // "populate" was enabled so tabs should be populated.
74 ListValue* tabs = NULL;
75 EXPECT_TRUE(result.get()->GetList(keys::kTabsKey, &tabs));
76
77 // TODO(aa): Can't assume window is focused. On mac, calling Activate() from a
78 // browser test doesn't seem to do anything, so can't test the opposite
79 // either.
80 EXPECT_EQ(browser()->window()->IsActive(),
81 utils::GetBoolean(result.get(), "focused"));
82
83 // TODO(aa): Minimized and maximized dimensions. Is there a way to set
84 // minimize/maximize programmatically?
85
86 // Popup.
87 Browser* popup_browser = Browser::CreateWithParams(
88 Browser::CreateParams(Browser::TYPE_POPUP, browser()->profile()));
89 result.reset(utils::ToDictionary(
90 utils::RunFunctionAndReturnResult(
91 new GetWindowFunction(),
92 base::StringPrintf(
93 "[%u]", ExtensionTabUtil::GetWindowId(popup_browser)),
94 browser())));
95 EXPECT_EQ("popup", utils::GetString(result.get(), "type"));
96
97 // Panel.
98 Browser* panel_browser = Browser::CreateWithParams(
99 Browser::CreateParams(Browser::TYPE_PANEL, browser()->profile()));
100 result.reset(utils::ToDictionary(
101 utils::RunFunctionAndReturnResult(
102 new GetWindowFunction(),
103 base::StringPrintf(
104 "[%u]", ExtensionTabUtil::GetWindowId(panel_browser)),
105 browser())));
106 EXPECT_EQ("panel", utils::GetString(result.get(), "type"));
107
108 // Incognito.
109 Browser* incognito_browser = CreateIncognitoBrowser();
110 int incognito_window_id = ExtensionTabUtil::GetWindowId(incognito_browser);
111
112 // Without "include_incognito".
113 EXPECT_TRUE(MatchPattern(
114 utils::RunFunctionAndReturnError(
115 new GetWindowFunction(),
116 base::StringPrintf("[%u]", incognito_window_id),
117 browser()),
118 keys::kWindowNotFoundError));
119
120 // With "include_incognito".
121 result.reset(utils::ToDictionary(
122 utils::RunFunctionAndReturnResult(
123 new GetWindowFunction(),
124 base::StringPrintf("[%u]", incognito_window_id),
125 browser(),
126 utils::INCLUDE_INCOGNITO)));
127 EXPECT_TRUE(utils::GetBoolean(result.get(), "incognito"));
128 }
129
130 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetCurrentWindow) {
131 int window_id = ExtensionTabUtil::GetWindowId(browser());
132 Browser* new_browser = CreateBrowser(browser()->profile());
133 int new_id = ExtensionTabUtil::GetWindowId(new_browser);
134
135 // Get the current window using new_browser.
136 scoped_ptr<base::DictionaryValue> result(utils::ToDictionary(
137 utils::RunFunctionAndReturnResult(
138 new GetCurrentWindowFunction(),
139 "[]",
140 new_browser)));
141
142 // The id should match the window id of the browser instance that was passed
143 // to RunFunctionAndReturnResult.
144 EXPECT_EQ(new_id, utils::GetInteger(result.get(), "id"));
145 ListValue* tabs = NULL;
146 EXPECT_FALSE(result.get()->GetList(keys::kTabsKey, &tabs));
147
148 // Get the current window using the old window and make the tabs populated.
149 result.reset(utils::ToDictionary(
150 utils::RunFunctionAndReturnResult(
151 new GetCurrentWindowFunction(),
152 "[{\"populate\": true}]",
153 browser())));
154
155 // The id should match the window id of the browser instance that was passed
156 // to RunFunctionAndReturnResult.
157 EXPECT_EQ(window_id, utils::GetInteger(result.get(), "id"));
158 // "populate" was enabled so tabs should be populated.
159 EXPECT_TRUE(result.get()->GetList(keys::kTabsKey, &tabs));
160 }
161
162 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetLastFocusedWindow) {
163 // Create a new window which making it the "last focused" window.
164 // Note that "last focused" means the "top" most window.
165 Browser* new_browser = CreateBrowser(browser()->profile());
166 int focused_window_id = ExtensionTabUtil::GetWindowId(new_browser);
167
168 scoped_ptr<base::DictionaryValue> result(utils::ToDictionary(
169 utils::RunFunctionAndReturnResult(
170 new GetLastFocusedWindowFunction(),
171 "[]",
172 new_browser)));
173
174 // The id should always match the last focused window and does not depend
175 // on what was passed to RunFunctionAndReturnResult.
176 EXPECT_EQ(focused_window_id, utils::GetInteger(result.get(), "id"));
177 ListValue* tabs = NULL;
178 EXPECT_FALSE(result.get()->GetList(keys::kTabsKey, &tabs));
179
180 result.reset(utils::ToDictionary(
181 utils::RunFunctionAndReturnResult(
182 new GetLastFocusedWindowFunction(),
183 "[{\"populate\": true}]",
184 browser())));
185
186 // The id should always match the last focused window and does not depend
187 // on what was passed to RunFunctionAndReturnResult.
188 EXPECT_EQ(focused_window_id, utils::GetInteger(result.get(), "id"));
189 // "populate" was enabled so tabs should be populated.
190 EXPECT_TRUE(result.get()->GetList(keys::kTabsKey, &tabs));
191 }
192
193 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, GetAllWindows) {
194 const size_t NUM_WINDOWS = 5;
195 std::set<int> window_ids;
196 std::set<int> result_ids;
197 window_ids.insert(ExtensionTabUtil::GetWindowId(browser()));
198
199 for (size_t i = 0; i < NUM_WINDOWS - 1; ++i) {
200 Browser* new_browser = CreateBrowser(browser()->profile());
201 window_ids.insert(ExtensionTabUtil::GetWindowId(new_browser));
202 }
203
204 scoped_ptr<base::ListValue> result(utils::ToList(
205 utils::RunFunctionAndReturnResult(
206 new GetAllWindowsFunction(),
207 "[]",
208 browser())));
209
210 ListValue* windows = result.get();
211 EXPECT_EQ(NUM_WINDOWS, windows->GetSize());
212 for (size_t i = 0; i < NUM_WINDOWS; ++i) {
213 DictionaryValue* result_window = NULL;
214 EXPECT_TRUE(windows->GetDictionary(i, &result_window));
215 result_ids.insert(utils::GetInteger(result_window, "id"));
216
217 // "populate" was not passed in so tabs are not populated.
218 ListValue* tabs = NULL;
219 EXPECT_FALSE(result_window->GetList(keys::kTabsKey, &tabs));
220 }
221 // The returned ids should contain all the current browser instance ids.
222 EXPECT_EQ(window_ids, result_ids);
223
224 result_ids.clear();
225 result.reset(utils::ToList(
226 utils::RunFunctionAndReturnResult(
227 new GetAllWindowsFunction(),
228 "[{\"populate\": true}]",
229 browser())));
230
231 windows = result.get();
232 EXPECT_EQ(NUM_WINDOWS, windows->GetSize());
233 for (size_t i = 0; i < windows->GetSize(); ++i) {
234 DictionaryValue* result_window = NULL;
235 EXPECT_TRUE(windows->GetDictionary(i, &result_window));
236 result_ids.insert(utils::GetInteger(result_window, "id"));
237
238 // "populate" was enabled so tabs should be populated.
239 ListValue* tabs = NULL;
240 EXPECT_TRUE(result_window->GetList(keys::kTabsKey, &tabs));
241 }
242 // The returned ids should contain all the current browser instance ids.
243 EXPECT_EQ(window_ids, result_ids);
244 }
245
246 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, UpdateNoPermissions) {
247 // The test empty extension has no permissions, therefore it should not get
248 // tab data in the function result.
249 scoped_refptr<UpdateTabFunction> update_tab_function(new UpdateTabFunction());
250 scoped_refptr<extensions::Extension> empty_extension(
251 utils::CreateEmptyExtension());
252 update_tab_function->set_extension(empty_extension.get());
253 // Without a callback the function will not generate a result.
254 update_tab_function->set_has_callback(true);
255
256 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnResult(
257 update_tab_function.get(),
258 "[null, {\"url\": \"neutrinos\"}]",
259 browser()));
260 EXPECT_EQ(base::Value::TYPE_NULL, result->GetType());
261 }
262
263 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
264 DefaultToIncognitoWhenItIsForced) {
265 static const char kArgsWithoutExplicitIncognitoParam[] =
266 "[{\"url\": \"about:blank\"}]";
267 // Force Incognito mode.
268 IncognitoModePrefs::SetAvailability(browser()->profile()->GetPrefs(),
269 IncognitoModePrefs::FORCED);
270 // Run without an explicit "incognito" param.
271 scoped_ptr<base::DictionaryValue> result(utils::ToDictionary(
272 utils::RunFunctionAndReturnResult(
273 new CreateWindowFunction(),
274 kArgsWithoutExplicitIncognitoParam,
275 browser(),
276 utils::INCLUDE_INCOGNITO)));
277
278 // Make sure it is a new(different) window.
279 EXPECT_NE(ExtensionTabUtil::GetWindowId(browser()),
280 utils::GetInteger(result.get(), "id"));
281 // ... and it is incognito.
282 EXPECT_TRUE(utils::GetBoolean(result.get(), "incognito"));
283
284 // Now try creating a window from incognito window.
285 Browser* incognito_browser = CreateIncognitoBrowser();
286 // Run without an explicit "incognito" param.
287 result.reset(utils::ToDictionary(
288 utils::RunFunctionAndReturnResult(
289 new CreateWindowFunction(),
290 kArgsWithoutExplicitIncognitoParam,
291 incognito_browser,
292 utils::INCLUDE_INCOGNITO)));
293 // Make sure it is a new(different) window.
294 EXPECT_NE(ExtensionTabUtil::GetWindowId(incognito_browser),
295 utils::GetInteger(result.get(), "id"));
296 // ... and it is incognito.
297 EXPECT_TRUE(utils::GetBoolean(result.get(), "incognito"));
298 }
299
300 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
301 DefaultToIncognitoWhenItIsForcedAndNoArgs) {
302 static const char kEmptyArgs[] = "[]";
303 // Force Incognito mode.
304 IncognitoModePrefs::SetAvailability(browser()->profile()->GetPrefs(),
305 IncognitoModePrefs::FORCED);
306 // Run without an explicit "incognito" param.
307 scoped_ptr<base::DictionaryValue> result(utils::ToDictionary(
308 utils::RunFunctionAndReturnResult(
309 new CreateWindowFunction(),
310 kEmptyArgs,
311 browser(),
312 utils::INCLUDE_INCOGNITO)));
313
314 // Make sure it is a new(different) window.
315 EXPECT_NE(ExtensionTabUtil::GetWindowId(browser()),
316 utils::GetInteger(result.get(), "id"));
317 // ... and it is incognito.
318 EXPECT_TRUE(utils::GetBoolean(result.get(), "incognito"));
319
320 // Now try creating a window from incognito window.
321 Browser* incognito_browser = CreateIncognitoBrowser();
322 // Run without an explicit "incognito" param.
323 result.reset(utils::ToDictionary(
324 utils::RunFunctionAndReturnResult(
325 new CreateWindowFunction(),
326 kEmptyArgs,
327 incognito_browser,
328 utils::INCLUDE_INCOGNITO)));
329 // Make sure it is a new(different) window.
330 EXPECT_NE(ExtensionTabUtil::GetWindowId(incognito_browser),
331 utils::GetInteger(result.get(), "id"));
332 // ... and it is incognito.
333 EXPECT_TRUE(utils::GetBoolean(result.get(), "incognito"));
334 }
335
336 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
337 DontCreateNormalWindowWhenIncognitoForced) {
338 static const char kArgsWithExplicitIncognitoParam[] =
339 "[{\"url\": \"about:blank\", \"incognito\": false }]";
340 // Force Incognito mode.
341 IncognitoModePrefs::SetAvailability(browser()->profile()->GetPrefs(),
342 IncognitoModePrefs::FORCED);
343
344 // Run with an explicit "incognito" param.
345 EXPECT_TRUE(MatchPattern(
346 utils::RunFunctionAndReturnError(
347 new CreateWindowFunction(),
348 kArgsWithExplicitIncognitoParam,
349 browser()),
350 keys::kIncognitoModeIsForced));
351
352 // Now try opening a normal window from incognito window.
353 Browser* incognito_browser = CreateIncognitoBrowser();
354 // Run with an explicit "incognito" param.
355 EXPECT_TRUE(MatchPattern(
356 utils::RunFunctionAndReturnError(
357 new CreateWindowFunction(),
358 kArgsWithExplicitIncognitoParam,
359 incognito_browser),
360 keys::kIncognitoModeIsForced));
361 }
362
363 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest,
364 DontCreateIncognitoWindowWhenIncognitoDisabled) {
365 static const char kArgs[] =
366 "[{\"url\": \"about:blank\", \"incognito\": true }]";
367
368 Browser* incognito_browser = CreateIncognitoBrowser();
369 // Disable Incognito mode.
370 IncognitoModePrefs::SetAvailability(browser()->profile()->GetPrefs(),
371 IncognitoModePrefs::DISABLED);
372 // Run in normal window.
373 EXPECT_TRUE(MatchPattern(
374 utils::RunFunctionAndReturnError(
375 new CreateWindowFunction(),
376 kArgs,
377 browser()),
378 keys::kIncognitoModeIsDisabled));
379
380 // Run in incognito window.
381 EXPECT_TRUE(MatchPattern(
382 utils::RunFunctionAndReturnError(
383 new CreateWindowFunction(),
384 kArgs,
385 incognito_browser),
386 keys::kIncognitoModeIsDisabled));
387 }
388
389 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, QueryCurrentWindowTabs) {
390 const size_t kExtraWindows = 3;
391 for (size_t i = 0; i < kExtraWindows; ++i)
392 CreateBrowser(browser()->profile());
393
394 GURL url;
395 AddTabAtIndexToBrowser(browser(), 0, url, content::PAGE_TRANSITION_LINK);
396 int window_id = ExtensionTabUtil::GetWindowId(browser());
397
398 // Get tabs in the 'current' window called from non-focused browser.
399 scoped_ptr<base::ListValue> result(utils::ToList(
400 utils::RunFunctionAndReturnResult(
401 new QueryTabsFunction(),
402 "[{\"currentWindow\":true}]",
403 browser())));
404
405 ListValue* result_tabs = result.get();
406 // We should have one initial tab and one added tab.
407 EXPECT_EQ(2u, result_tabs->GetSize());
408 for (size_t i = 0; i < result_tabs->GetSize(); ++i) {
409 DictionaryValue* result_tab = NULL;
410 EXPECT_TRUE(result_tabs->GetDictionary(i, &result_tab));
411 EXPECT_EQ(window_id, utils::GetInteger(result_tab, keys::kWindowIdKey));
412 }
413
414 // Get tabs NOT in the 'current' window called from non-focused browser.
415 result.reset(utils::ToList(
416 utils::RunFunctionAndReturnResult(
417 new QueryTabsFunction(),
418 "[{\"currentWindow\":false}]",
419 browser())));
420
421 result_tabs = result.get();
422 // We should have one tab for each extra window.
423 EXPECT_EQ(kExtraWindows, result_tabs->GetSize());
424 for (size_t i = 0; i < kExtraWindows; ++i) {
425 DictionaryValue* result_tab = NULL;
426 EXPECT_TRUE(result_tabs->GetDictionary(i, &result_tab));
427 EXPECT_NE(window_id, utils::GetInteger(result_tab, keys::kWindowIdKey));
428 }
429 }
430
431 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, QueryLastFocusedWindowTabs) {
432 const size_t kExtraWindows = 2;
433 for (size_t i = 0; i < kExtraWindows; ++i)
434 CreateBrowser(browser()->profile());
435
436 Browser* focused_window = CreateBrowser(browser()->profile());
437 GURL url;
438 AddTabAtIndexToBrowser(focused_window, 0, url, content::PAGE_TRANSITION_LINK);
439 int focused_window_id = ExtensionTabUtil::GetWindowId(focused_window);
440
441 // Get tabs in the 'last focused' window called from non-focused browser.
442 scoped_ptr<base::ListValue> result(utils::ToList(
443 utils::RunFunctionAndReturnResult(
444 new QueryTabsFunction(),
445 "[{\"lastFocusedWindow\":true}]",
446 browser())));
447
448 ListValue* result_tabs = result.get();
449 // We should have one initial tab and one added tab.
450 EXPECT_EQ(2u, result_tabs->GetSize());
451 for (size_t i = 0; i < result_tabs->GetSize(); ++i) {
452 DictionaryValue* result_tab = NULL;
453 EXPECT_TRUE(result_tabs->GetDictionary(i, &result_tab));
454 EXPECT_EQ(focused_window_id, utils::GetInteger(result_tab,
455 keys::kWindowIdKey));
456 }
457
458 // Get tabs NOT in the 'last focused' window called from the focused browser.
459 result.reset(utils::ToList(
460 utils::RunFunctionAndReturnResult(
461 new QueryTabsFunction(),
462 "[{\"lastFocusedWindow\":false}]",
463 browser())));
464
465 result_tabs = result.get();
466 // We should get one tab for each extra window and one for the initial window.
467 EXPECT_EQ(kExtraWindows + 1, result_tabs->GetSize());
468 for (size_t i = 0; i < result_tabs->GetSize(); ++i) {
469 DictionaryValue* result_tab = NULL;
470 EXPECT_TRUE(result_tabs->GetDictionary(i, &result_tab));
471 EXPECT_NE(focused_window_id, utils::GetInteger(result_tab,
472 keys::kWindowIdKey));
473 }
474 }
475
476 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, DontCreateTabInClosingPopupWindow) {
477 // Test creates new popup window, closes it right away and then tries to open
478 // a new tab in it. Tab should not be opened in the popup window, but in a
479 // tabbed browser window.
480 Browser* popup_browser = Browser::CreateWithParams(
481 Browser::CreateParams(Browser::TYPE_POPUP, browser()->profile()));
482 int window_id = ExtensionTabUtil::GetWindowId(popup_browser);
483 popup_browser->CloseWindow();
484
485 scoped_refptr<CreateTabFunction> create_tab_function(new CreateTabFunction());
486 // Without a callback the function will not generate a result.
487 create_tab_function->set_has_callback(true);
488
489 static const char kNewBlankTabArgs[] =
490 "[{\"url\": \"about:blank\", \"windowId\": %u}]";
491
492 scoped_ptr<base::DictionaryValue> result(utils::ToDictionary(
493 utils::RunFunctionAndReturnResult(
494 create_tab_function.get(),
495 base::StringPrintf(kNewBlankTabArgs, window_id),
496 browser())));
497
498 EXPECT_NE(window_id, utils::GetInteger(result.get(), "windowId"));
499 }
500
501 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, InvalidUpdateWindowState) {
502 int window_id = ExtensionTabUtil::GetWindowId(browser());
503
504 static const char kArgsMinimizedWithFocus[] =
505 "[%u, {\"state\": \"minimized\", \"focused\": true}]";
506 EXPECT_TRUE(MatchPattern(
507 utils::RunFunctionAndReturnError(
508 new UpdateWindowFunction(),
509 base::StringPrintf(kArgsMinimizedWithFocus, window_id),
510 browser()),
511 keys::kInvalidWindowStateError));
512
513 static const char kArgsMaximizedWithoutFocus[] =
514 "[%u, {\"state\": \"maximized\", \"focused\": false}]";
515 EXPECT_TRUE(MatchPattern(
516 utils::RunFunctionAndReturnError(
517 new UpdateWindowFunction(),
518 base::StringPrintf(kArgsMaximizedWithoutFocus, window_id),
519 browser()),
520 keys::kInvalidWindowStateError));
521
522 static const char kArgsMinimizedWithBounds[] =
523 "[%u, {\"state\": \"minimized\", \"width\": 500}]";
524 EXPECT_TRUE(MatchPattern(
525 utils::RunFunctionAndReturnError(
526 new UpdateWindowFunction(),
527 base::StringPrintf(kArgsMinimizedWithBounds, window_id),
528 browser()),
529 keys::kInvalidWindowStateError));
530
531 static const char kArgsMaximizedWithBounds[] =
532 "[%u, {\"state\": \"maximized\", \"width\": 500}]";
533 EXPECT_TRUE(MatchPattern(
534 utils::RunFunctionAndReturnError(
535 new UpdateWindowFunction(),
536 base::StringPrintf(kArgsMaximizedWithBounds, window_id),
537 browser()),
538 keys::kInvalidWindowStateError));
539 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module_constants.cc ('k') | chrome/browser/extensions/extension_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698