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

Side by Side Diff: chrome/browser/apps/app_window_interactive_uitest.cc

Issue 958923004: Fix hiding behavior when creating app windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove changes to platform_apps/hidden/test.js Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/hidden_with_id/empty.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/apps/app_browsertest_util.h" 5 #include "chrome/browser/apps/app_browsertest_util.h"
6 #include "chrome/browser/lifetime/application_lifetime.h" 6 #include "chrome/browser/lifetime/application_lifetime.h"
7 #include "chrome/browser/ui/browser_iterator.h" 7 #include "chrome/browser/ui/browser_iterator.h"
8 #include "chrome/browser/ui/browser_window.h" 8 #include "chrome/browser/ui/browser_window.h"
9 #include "chrome/test/base/interactive_test_utils.h" 9 #include "chrome/test/base/interactive_test_utils.h"
10 #include "extensions/browser/app_window/native_app_window.h" 10 #include "extensions/browser/app_window/native_app_window.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 } 454 }
455 455
456 IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, MAYBE_TestShow) { 456 IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, MAYBE_TestShow) {
457 ASSERT_TRUE(RunAppWindowInteractiveTest("testShow")) << message_; 457 ASSERT_TRUE(RunAppWindowInteractiveTest("testShow")) << message_;
458 } 458 }
459 459
460 IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, TestDrawAttention) { 460 IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, TestDrawAttention) {
461 ASSERT_TRUE(RunAppWindowInteractiveTest("testDrawAttention")) << message_; 461 ASSERT_TRUE(RunAppWindowInteractiveTest("testDrawAttention")) << message_;
462 } 462 }
463 463
464 IN_PROC_BROWSER_TEST_F(AppWindowInteractiveTest, TestCreateHidden) {
465 // Created hidden both times.
466 {
467 ExtensionTestMessageListener launched_listener("Launched", true);
468 LoadAndLaunchPlatformApp("hidden_with_id", &launched_listener);
469 EXPECT_TRUE(launched_listener.WaitUntilSatisfied());
470 ExtensionTestMessageListener create_listener_1("Launched", true);
471 launched_listener.Reply("createHidden");
472 EXPECT_TRUE(create_listener_1.WaitUntilSatisfied());
473 AppWindow* app_window = GetFirstAppWindow();
474 EXPECT_TRUE(app_window->is_hidden());
475 ExtensionTestMessageListener create_listener_2("Launched", false);
476 create_listener_1.Reply("createHidden");
477 EXPECT_TRUE(create_listener_2.WaitUntilSatisfied());
478 EXPECT_TRUE(app_window->is_hidden());
479 app_window->GetBaseWindow()->Close();
480 }
481
482 // Created hidden, then visible. The second create should show the window.
483 {
484 ExtensionTestMessageListener launched_listener("Launched", true);
485 LoadAndLaunchPlatformApp("hidden_with_id", &launched_listener);
486 EXPECT_TRUE(launched_listener.WaitUntilSatisfied());
487 ExtensionTestMessageListener create_listener_1("Launched", true);
488 launched_listener.Reply("createHidden");
489 EXPECT_TRUE(create_listener_1.WaitUntilSatisfied());
490 AppWindow* app_window = GetFirstAppWindow();
491 EXPECT_TRUE(app_window->is_hidden());
492 ExtensionTestMessageListener create_listener_2("Launched", false);
493 create_listener_1.Reply("createVisible");
494 EXPECT_TRUE(create_listener_2.WaitUntilSatisfied());
495 EXPECT_FALSE(app_window->is_hidden());
496 app_window->GetBaseWindow()->Close();
497 }
498 }
499
464 // Only Linux and Windows use keep-alive to determine when to shut down. 500 // Only Linux and Windows use keep-alive to determine when to shut down.
465 #if defined(OS_LINUX) || defined(OS_WIN) 501 #if defined(OS_LINUX) || defined(OS_WIN)
466 502
467 // In general, hidden windows should not keep Chrome alive. The exception is 503 // In general, hidden windows should not keep Chrome alive. The exception is
468 // when windows are created hidden, we allow the app some time to show the 504 // when windows are created hidden, we allow the app some time to show the
469 // the window. 505 // the window.
470 class AppWindowHiddenKeepAliveTest : public extensions::PlatformAppBrowserTest { 506 class AppWindowHiddenKeepAliveTest : public extensions::PlatformAppBrowserTest {
471 protected: 507 protected:
472 AppWindowHiddenKeepAliveTest() {} 508 AppWindowHiddenKeepAliveTest() {}
473 509
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 // The app window will show after 3 seconds. 564 // The app window will show after 3 seconds.
529 ExtensionTestMessageListener shown_listener("Shown", false); 565 ExtensionTestMessageListener shown_listener("Shown", false);
530 launched_listener.Reply(""); 566 launched_listener.Reply("");
531 EXPECT_TRUE(shown_listener.WaitUntilSatisfied()); 567 EXPECT_TRUE(shown_listener.WaitUntilSatisfied());
532 EXPECT_FALSE(app_window->is_hidden()); 568 EXPECT_FALSE(app_window->is_hidden());
533 EXPECT_TRUE(chrome::WillKeepAlive()); 569 EXPECT_TRUE(chrome::WillKeepAlive());
534 app_window->GetBaseWindow()->Close(); 570 app_window->GetBaseWindow()->Close();
535 } 571 }
536 572
537 #endif 573 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/hidden_with_id/empty.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698