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

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_views_browsertest.cc

Issue 1778873002: Replace Increment/DecrementKeepAliveCount by ScopedKeepAlives (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KAObserver
Patch Set: replace the commented dcheck by a dlog Created 4 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
OLDNEW
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/ui/app_list/app_list_service_views.h" 5 #include "chrome/browser/ui/app_list/app_list_service_views.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "chrome/browser/extensions/extension_browsertest.h" 11 #include "chrome/browser/extensions/extension_browsertest.h"
12 #include "chrome/browser/lifetime/application_lifetime.h" 12 #include "chrome/browser/lifetime/keep_alive_registry.h"
13 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 13 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
14 #include "chrome/browser/ui/app_list/test/chrome_app_list_test_support.h" 14 #include "chrome/browser/ui/app_list/test/chrome_app_list_test_support.h"
15 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_commands.h" 16 #include "chrome/browser/ui/browser_commands.h"
17 #include "chrome/common/chrome_paths.h" 17 #include "chrome/common/chrome_paths.h"
18 #include "chrome/test/base/in_process_browser_test.h" 18 #include "chrome/test/base/in_process_browser_test.h"
19 #include "content/public/browser/notification_service.h" 19 #include "content/public/browser/notification_service.h"
20 #include "content/public/test/test_utils.h" 20 #include "content/public/test/test_utils.h"
21 #include "ui/app_list/app_list_switches.h" 21 #include "ui/app_list/app_list_switches.h"
22 #include "ui/app_list/views/app_list_main_view.h" 22 #include "ui/app_list/views/app_list_main_view.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 content::WindowedNotificationObserver close_observer( 113 content::WindowedNotificationObserver close_observer(
114 chrome::NOTIFICATION_BROWSER_CLOSED, content::Source<Browser>(browser())); 114 chrome::NOTIFICATION_BROWSER_CLOSED, content::Source<Browser>(browser()));
115 chrome::CloseWindow(browser()); 115 chrome::CloseWindow(browser());
116 close_observer.Wait(); 116 close_observer.Wait();
117 117
118 ui::test::EventGenerator generator(service->GetAppListWindow()); 118 ui::test::EventGenerator generator(service->GetAppListWindow());
119 generator.PressKey(ui::VKEY_ESCAPE, 0); 119 generator.PressKey(ui::VKEY_ESCAPE, 0);
120 120
121 #if !defined(OS_CHROMEOS) 121 #if !defined(OS_CHROMEOS)
122 EXPECT_TRUE(chrome::WillKeepAlive()); 122 EXPECT_TRUE(KeepAliveRegistry::GetInstance()->IsKeepingAlive());
123 #endif 123 #endif
124 124
125 base::RunLoop().RunUntilIdle(); 125 base::RunLoop().RunUntilIdle();
126 126
127 #if !defined(OS_CHROMEOS) 127 #if !defined(OS_CHROMEOS)
128 EXPECT_FALSE(chrome::WillKeepAlive()); 128 EXPECT_FALSE(KeepAliveRegistry::GetInstance()->IsKeepingAlive());
129 #endif 129 #endif
130 EXPECT_FALSE(service->GetAppListWindow()); 130 EXPECT_FALSE(service->GetAppListWindow());
131 } 131 }
132 132
133 // Tests for opening the app info dialog from the app list. 133 // Tests for opening the app info dialog from the app list.
134 class AppListControllerAppInfoDialogBrowserTest : public ExtensionBrowserTest { 134 class AppListControllerAppInfoDialogBrowserTest : public ExtensionBrowserTest {
135 public: 135 public:
136 AppListControllerAppInfoDialogBrowserTest() {} 136 AppListControllerAppInfoDialogBrowserTest() {}
137 ~AppListControllerAppInfoDialogBrowserTest() override {} 137 ~AppListControllerAppInfoDialogBrowserTest() override {}
138 138
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 service->ShowForAppInstall(browser()->profile(), extension->id(), false); 235 service->ShowForAppInstall(browser()->profile(), extension->id(), false);
236 app_list::AppListView* app_list_view = GetAppListView(service); 236 app_list::AppListView* app_list_view = GetAppListView(service);
237 ASSERT_TRUE(app_list_view); 237 ASSERT_TRUE(app_list_view);
238 238
239 app_list::ContentsView* contents_view = 239 app_list::ContentsView* contents_view =
240 app_list_view->app_list_main_view()->contents_view(); 240 app_list_view->app_list_main_view()->contents_view();
241 241
242 EXPECT_TRUE(contents_view->IsStateActive(app_list::AppListModel::STATE_APPS)); 242 EXPECT_TRUE(contents_view->IsStateActive(app_list::AppListModel::STATE_APPS));
243 } 243 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/better_session_restore_browsertest.cc ('k') | chrome/browser/ui/ash/ash_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698