| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/ephemeral_app_browsertest.h" | 5 #include "chrome/browser/apps/ephemeral_app_browsertest.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "apps/saved_files_service.h" | 9 #include "apps/saved_files_service.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 ASSERT_TRUE(event_router->ExtensionHasEventListener( | 372 ASSERT_TRUE(event_router->ExtensionHasEventListener( |
| 373 extension->id(), alarms::OnAlarm::kEventName)); | 373 extension->id(), alarms::OnAlarm::kEventName)); |
| 374 | 374 |
| 375 // Dispatch the alarm event again and verify that the event page did not get | 375 // Dispatch the alarm event again and verify that the event page did not get |
| 376 // loaded for the app. | 376 // loaded for the app. |
| 377 DispatchAlarmEvent(event_router, extension->id()); | 377 DispatchAlarmEvent(event_router, extension->id()); |
| 378 VerifyAppNotLoaded(extension->id()); | 378 VerifyAppNotLoaded(extension->id()); |
| 379 } | 379 } |
| 380 | 380 |
| 381 // Verify that ephemeral apps will receive messages while they are running. | 381 // Verify that ephemeral apps will receive messages while they are running. |
| 382 IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, ReceiveMessagesWhenLaunched) { | 382 // Flaky test: crbug.com/394426 |
| 383 IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, |
| 384 DISABLED_ReceiveMessagesWhenLaunched) { |
| 383 const Extension* receiver = | 385 const Extension* receiver = |
| 384 InstallAndLaunchEphemeralApp(kMessagingReceiverApp); | 386 InstallAndLaunchEphemeralApp(kMessagingReceiverApp); |
| 385 ASSERT_TRUE(receiver); | 387 ASSERT_TRUE(receiver); |
| 386 | 388 |
| 387 // Verify that messages are received while the app is running. | 389 // Verify that messages are received while the app is running. |
| 388 ExtensionApiTest::ResultCatcher result_catcher; | 390 ExtensionApiTest::ResultCatcher result_catcher; |
| 389 LoadAndLaunchPlatformApp("ephemeral_apps/messaging_sender_success", | 391 LoadAndLaunchPlatformApp("ephemeral_apps/messaging_sender_success", |
| 390 "Launched"); | 392 "Launched"); |
| 391 EXPECT_TRUE(result_catcher.GetNextResult()); | 393 EXPECT_TRUE(result_catcher.GetNextResult()); |
| 392 | 394 |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 703 |
| 702 // Ensure that when the app is promoted to an installed app, the bit in the | 704 // Ensure that when the app is promoted to an installed app, the bit in the |
| 703 // creation flags is cleared. | 705 // creation flags is cleared. |
| 704 PromoteEphemeralApp(app); | 706 PromoteEphemeralApp(app); |
| 705 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); | 707 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); |
| 706 | 708 |
| 707 int creation_flags = | 709 int creation_flags = |
| 708 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); | 710 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); |
| 709 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); | 711 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); |
| 710 } | 712 } |
| OLD | NEW |