OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/extension_tabs_module.h" | 5 #include "chrome/browser/extensions/extension_tabs_module.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 create_tab_function.get(), | 404 create_tab_function.get(), |
405 base::StringPrintf(kNewBlankTabArgs, window_id), | 405 base::StringPrintf(kNewBlankTabArgs, window_id), |
406 browser()))); | 406 browser()))); |
407 | 407 |
408 EXPECT_NE(window_id, GetInteger(result.get(), "windowId")); | 408 EXPECT_NE(window_id, GetInteger(result.get(), "windowId")); |
409 } | 409 } |
410 | 410 |
411 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, InvalidUpdateWindowState) { | 411 IN_PROC_BROWSER_TEST_F(ExtensionTabsTest, InvalidUpdateWindowState) { |
412 int window_id = ExtensionTabUtil::GetWindowId(browser()); | 412 int window_id = ExtensionTabUtil::GetWindowId(browser()); |
413 | 413 |
414 #if !defined(USE_AURA) | |
415 // Disabled for now (crbug.com/105173) because window minimization is not | |
416 // supported on Aura yet (crbug.com/104571). | |
417 static const char kArgsMinimizedWithFocus[] = | 414 static const char kArgsMinimizedWithFocus[] = |
418 "[%u, {\"state\": \"minimized\", \"focused\": true}]"; | 415 "[%u, {\"state\": \"minimized\", \"focused\": true}]"; |
419 EXPECT_TRUE(MatchPattern( | 416 EXPECT_TRUE(MatchPattern( |
420 RunFunctionAndReturnError( | 417 RunFunctionAndReturnError( |
421 new UpdateWindowFunction(), | 418 new UpdateWindowFunction(), |
422 base::StringPrintf(kArgsMinimizedWithFocus, window_id), | 419 base::StringPrintf(kArgsMinimizedWithFocus, window_id), |
423 browser()), | 420 browser()), |
424 keys::kInvalidWindowStateError)); | 421 keys::kInvalidWindowStateError)); |
425 #endif | |
426 | 422 |
427 static const char kArgsMaximizedWithoutFocus[] = | 423 static const char kArgsMaximizedWithoutFocus[] = |
428 "[%u, {\"state\": \"maximized\", \"focused\": false}]"; | 424 "[%u, {\"state\": \"maximized\", \"focused\": false}]"; |
429 EXPECT_TRUE(MatchPattern( | 425 EXPECT_TRUE(MatchPattern( |
430 RunFunctionAndReturnError( | 426 RunFunctionAndReturnError( |
431 new UpdateWindowFunction(), | 427 new UpdateWindowFunction(), |
432 base::StringPrintf(kArgsMaximizedWithoutFocus, window_id), | 428 base::StringPrintf(kArgsMaximizedWithoutFocus, window_id), |
433 browser()), | 429 browser()), |
434 keys::kInvalidWindowStateError)); | 430 keys::kInvalidWindowStateError)); |
435 | 431 |
436 #if !defined(USE_AURA) | |
437 // Disabled for now (crbug.com/105173) because window minimization is not | |
438 // supported on Aura yet (crbug.com/104571). | |
439 static const char kArgsMinimizedWithBounds[] = | 432 static const char kArgsMinimizedWithBounds[] = |
440 "[%u, {\"state\": \"minimized\", \"width\": 500}]"; | 433 "[%u, {\"state\": \"minimized\", \"width\": 500}]"; |
441 EXPECT_TRUE(MatchPattern( | 434 EXPECT_TRUE(MatchPattern( |
442 RunFunctionAndReturnError( | 435 RunFunctionAndReturnError( |
443 new UpdateWindowFunction(), | 436 new UpdateWindowFunction(), |
444 base::StringPrintf(kArgsMinimizedWithBounds, window_id), | 437 base::StringPrintf(kArgsMinimizedWithBounds, window_id), |
445 browser()), | 438 browser()), |
446 keys::kInvalidWindowStateError)); | 439 keys::kInvalidWindowStateError)); |
447 #endif | |
448 | 440 |
449 static const char kArgsMaximizedWithBounds[] = | 441 static const char kArgsMaximizedWithBounds[] = |
450 "[%u, {\"state\": \"maximized\", \"width\": 500}]"; | 442 "[%u, {\"state\": \"maximized\", \"width\": 500}]"; |
451 EXPECT_TRUE(MatchPattern( | 443 EXPECT_TRUE(MatchPattern( |
452 RunFunctionAndReturnError( | 444 RunFunctionAndReturnError( |
453 new UpdateWindowFunction(), | 445 new UpdateWindowFunction(), |
454 base::StringPrintf(kArgsMaximizedWithBounds, window_id), | 446 base::StringPrintf(kArgsMaximizedWithBounds, window_id), |
455 browser()), | 447 browser()), |
456 keys::kInvalidWindowStateError)); | 448 keys::kInvalidWindowStateError)); |
457 } | 449 } |
OLD | NEW |