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

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

Issue 1708343002: Add ScopedKeepAlive to c/b/lifetime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 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 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/apps/scoped_keep_alive.h"
10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" 9 #include "chrome/browser/extensions/api/tabs/tabs_api.h"
11 #include "chrome/browser/extensions/extension_function_test_utils.h" 10 #include "chrome/browser/extensions/extension_function_test_utils.h"
11 #include "chrome/browser/lifetime/scoped_keep_alive.h"
12 #include "chrome/browser/ui/apps/chrome_app_delegate.h" 12 #include "chrome/browser/ui/apps/chrome_app_delegate.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/extensions/app_launch_params.h" 14 #include "chrome/browser/ui/extensions/app_launch_params.h"
15 #include "chrome/browser/ui/extensions/application_launch.h" 15 #include "chrome/browser/ui/extensions/application_launch.h"
16 #include "content/public/browser/notification_service.h" 16 #include "content/public/browser/notification_service.h"
17 #include "content/public/test/browser_test_utils.h" 17 #include "content/public/test/browser_test_utils.h"
18 #include "content/public/test/test_utils.h" 18 #include "content/public/test/test_utils.h"
19 #include "extensions/browser/app_window/app_window_contents.h" 19 #include "extensions/browser/app_window/app_window_contents.h"
20 #include "extensions/browser/app_window/app_window_registry.h" 20 #include "extensions/browser/app_window/app_window_registry.h"
21 #include "extensions/browser/app_window/native_app_window.h" 21 #include "extensions/browser/app_window/native_app_window.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 .size(); 195 .size();
196 } 196 }
197 197
198 AppWindow* PlatformAppBrowserTest::CreateAppWindow(const Extension* extension) { 198 AppWindow* PlatformAppBrowserTest::CreateAppWindow(const Extension* extension) {
199 return CreateAppWindowFromParams(extension, AppWindow::CreateParams()); 199 return CreateAppWindowFromParams(extension, AppWindow::CreateParams());
200 } 200 }
201 201
202 AppWindow* PlatformAppBrowserTest::CreateAppWindowFromParams( 202 AppWindow* PlatformAppBrowserTest::CreateAppWindowFromParams(
203 const Extension* extension, 203 const Extension* extension,
204 const AppWindow::CreateParams& params) { 204 const AppWindow::CreateParams& params) {
205 AppWindow* window = 205 AppWindow* window = new AppWindow(
206 new AppWindow(browser()->profile(), 206 browser()->profile(), new ChromeAppDelegate(make_scoped_ptr(
207 new ChromeAppDelegate(make_scoped_ptr(new ScopedKeepAlive)), 207 new ScopedKeepAlive("ChromeAppDelegate"))),
208 extension); 208 extension);
209 window->Init(GURL(std::string()), new AppWindowContentsImpl(window), params); 209 window->Init(GURL(std::string()), new AppWindowContentsImpl(window), params);
210 return window; 210 return window;
211 } 211 }
212 212
213 void PlatformAppBrowserTest::CloseAppWindow(AppWindow* window) { 213 void PlatformAppBrowserTest::CloseAppWindow(AppWindow* window) {
214 content::WebContentsDestroyedWatcher destroyed_watcher( 214 content::WebContentsDestroyedWatcher destroyed_watcher(
215 window->web_contents()); 215 window->web_contents());
216 window->GetBaseWindow()->Close(); 216 window->GetBaseWindow()->Close();
217 destroyed_watcher.Wait(); 217 destroyed_watcher.Wait();
218 } 218 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 return app_window; 253 return app_window;
254 } 254 }
255 255
256 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( 256 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine(
257 base::CommandLine* command_line) { 257 base::CommandLine* command_line) {
258 PlatformAppBrowserTest::SetUpCommandLine(command_line); 258 PlatformAppBrowserTest::SetUpCommandLine(command_line);
259 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); 259 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis);
260 } 260 }
261 261
262 } // namespace extensions 262 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/apps/scoped_keep_alive.h » ('j') | chrome/browser/background/background_mode_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698