| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/launcher.h" | 5 #include "apps/launcher.h" |
| 6 #include "apps/shell_window.h" | 6 #include "apps/shell_window.h" |
| 7 #include "apps/shell_window_registry.h" | 7 #include "apps/shell_window_registry.h" |
| 8 #include "apps/ui/native_app_window.h" | 8 #include "apps/ui/native_app_window.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); | 365 ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); |
| 366 | 366 |
| 367 // Execute the menu item | 367 // Execute the menu item |
| 368 ExtensionTestMessageListener onclicked_listener("onClicked fired for id1", | 368 ExtensionTestMessageListener onclicked_listener("onClicked fired for id1", |
| 369 false); | 369 false); |
| 370 menu->ExecuteCommand(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST, 0); | 370 menu->ExecuteCommand(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST, 0); |
| 371 | 371 |
| 372 ASSERT_TRUE(onclicked_listener.WaitUntilSatisfied()); | 372 ASSERT_TRUE(onclicked_listener.WaitUntilSatisfied()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, DisallowNavigation) { | 375 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 376 // TODO(erg): linux_aura bringup: http://crbug.com/163931 |
| 377 #define MAYBE_DisallowNavigation DISABLED_DisallowNavigation |
| 378 #else |
| 379 #define MAYBE_DisallowNavigation DisallowNavigation |
| 380 #endif |
| 381 |
| 382 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_DisallowNavigation) { |
| 376 TabsAddedNotificationObserver observer(2); | 383 TabsAddedNotificationObserver observer(2); |
| 377 | 384 |
| 378 ASSERT_TRUE(StartEmbeddedTestServer()); | 385 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 379 ASSERT_TRUE(RunPlatformAppTest("platform_apps/navigation")) << message_; | 386 ASSERT_TRUE(RunPlatformAppTest("platform_apps/navigation")) << message_; |
| 380 | 387 |
| 381 observer.Wait(); | 388 observer.Wait(); |
| 382 ASSERT_EQ(2U, observer.tabs().size()); | 389 ASSERT_EQ(2U, observer.tabs().size()); |
| 383 EXPECT_EQ(std::string(chrome::kExtensionInvalidRequestURL), | 390 EXPECT_EQ(std::string(chrome::kExtensionInvalidRequestURL), |
| 384 observer.tabs()[0]->GetURL().spec()); | 391 observer.tabs()[0]->GetURL().spec()); |
| 385 EXPECT_EQ("http://chromium.org/", | 392 EXPECT_EQ("http://chromium.org/", |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 } | 532 } |
| 526 } | 533 } |
| 527 | 534 |
| 528 // Tests that launch data is sent through if the file extension matches. | 535 // Tests that launch data is sent through if the file extension matches. |
| 529 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithFileExtension) { | 536 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithFileExtension) { |
| 530 SetCommandLineArg(kTestFilePath); | 537 SetCommandLineArg(kTestFilePath); |
| 531 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_file_by_extension")) | 538 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_file_by_extension")) |
| 532 << message_; | 539 << message_; |
| 533 } | 540 } |
| 534 | 541 |
| 542 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 543 // TODO(erg): linux_aura bringup: http://crbug.com/163931 |
| 544 #define MAYBE_LaunchWithFileExtensionAndMimeType DISABLED_LaunchWithFileExtensio
nAndMimeType |
| 545 #else |
| 546 #define MAYBE_LaunchWithFileExtensionAndMimeType LaunchWithFileExtensionAndMimeT
ype |
| 547 #endif |
| 548 |
| 535 // Tests that launch data is sent through if the file extension and MIME type | 549 // Tests that launch data is sent through if the file extension and MIME type |
| 536 // both match. | 550 // both match. |
| 537 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, | 551 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, |
| 538 LaunchWithFileExtensionAndMimeType) { | 552 MAYBE_LaunchWithFileExtensionAndMimeType) { |
| 539 SetCommandLineArg(kTestFilePath); | 553 SetCommandLineArg(kTestFilePath); |
| 540 ASSERT_TRUE(RunPlatformAppTest( | 554 ASSERT_TRUE(RunPlatformAppTest( |
| 541 "platform_apps/launch_file_by_extension_and_type")) << message_; | 555 "platform_apps/launch_file_by_extension_and_type")) << message_; |
| 542 } | 556 } |
| 543 | 557 |
| 544 // Tests that launch data is sent through for a file with no extension if a | 558 // Tests that launch data is sent through for a file with no extension if a |
| 545 // handler accepts "". | 559 // handler accepts "". |
| 546 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithFileWithoutExtension) { | 560 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithFileWithoutExtension) { |
| 547 SetCommandLineArg("platform_apps/launch_files/test"); | 561 SetCommandLineArg("platform_apps/launch_files/test"); |
| 548 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_file_with_no_extension")) | 562 ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_file_with_no_extension")) |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 } | 706 } |
| 693 | 707 |
| 694 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MutationEventsDisabled) { | 708 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MutationEventsDisabled) { |
| 695 ASSERT_TRUE(RunPlatformAppTest("platform_apps/mutation_events")) << message_; | 709 ASSERT_TRUE(RunPlatformAppTest("platform_apps/mutation_events")) << message_; |
| 696 } | 710 } |
| 697 | 711 |
| 698 // Test that windows created with an id will remember and restore their | 712 // Test that windows created with an id will remember and restore their |
| 699 // geometry when opening new windows. | 713 // geometry when opening new windows. |
| 700 // Originally disabled due to flakiness (see http://crbug.com/155459) | 714 // Originally disabled due to flakiness (see http://crbug.com/155459) |
| 701 // but now because a regression breaks the test (http://crbug.com/160343). | 715 // but now because a regression breaks the test (http://crbug.com/160343). |
| 702 #if defined(TOOLKIT_GTK) | 716 // |
| 717 // TODO(erg): Now a linux_aura asan regression too: http://crbug.com/304555 |
| 718 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 703 #define MAYBE_ShellWindowRestorePosition DISABLED_ShellWindowRestorePosition | 719 #define MAYBE_ShellWindowRestorePosition DISABLED_ShellWindowRestorePosition |
| 704 #else | 720 #else |
| 705 #define MAYBE_ShellWindowRestorePosition ShellWindowRestorePosition | 721 #define MAYBE_ShellWindowRestorePosition ShellWindowRestorePosition |
| 706 #endif | 722 #endif |
| 707 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, | 723 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, |
| 708 MAYBE_ShellWindowRestorePosition) { | 724 MAYBE_ShellWindowRestorePosition) { |
| 709 ASSERT_TRUE(RunPlatformAppTest("platform_apps/geometry")); | 725 ASSERT_TRUE(RunPlatformAppTest("platform_apps/geometry")); |
| 710 } | 726 } |
| 711 | 727 |
| 712 // This appears to be unreliable on linux. | 728 // This appears to be unreliable on linux. |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 false); | 1298 false); |
| 1283 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); | 1299 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); |
| 1284 | 1300 |
| 1285 EXPECT_EQ(1, request_restart_call_count()); | 1301 EXPECT_EQ(1, request_restart_call_count()); |
| 1286 } | 1302 } |
| 1287 | 1303 |
| 1288 #endif // defined(OS_CHROMEOS) | 1304 #endif // defined(OS_CHROMEOS) |
| 1289 | 1305 |
| 1290 | 1306 |
| 1291 } // namespace extensions | 1307 } // namespace extensions |
| OLD | NEW |