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

Unified Diff: chrome/browser/extensions/load_and_launch_browsertest.cc

Issue 15947007: Move application restart and relaunch code out of ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pafooey Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_system.cc ('k') | chrome/browser/extensions/platform_app_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/load_and_launch_browsertest.cc
diff --git a/chrome/browser/extensions/load_and_launch_browsertest.cc b/chrome/browser/extensions/load_and_launch_browsertest.cc
deleted file mode 100644
index c48e2ba6de638bc683c96541af7af3799b0da7ba..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/load_and_launch_browsertest.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Tests for the --load-and-launch-app switch.
-// The two cases are when chrome is running and another process uses the switch
-// and when chrome is started from scratch.
-
-#include "base/test/test_timeouts.h"
-#include "chrome/browser/extensions/extension_browsertest.h"
-#include "chrome/browser/extensions/extension_test_message_listener.h"
-#include "chrome/browser/extensions/platform_app_browsertest_util.h"
-#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/common/chrome_switches.h"
-#include "content/public/test/test_launcher.h"
-
-namespace extensions {
-
-// TODO(jackhou): Enable this test once it works on OSX. It currently does not
-// work for the same reason --app-id doesn't. See http://crbug.com/148465
-#if defined(OS_MACOSX)
-#define MAYBE_LoadAndLaunchAppChromeRunning \
- DISABLED_LoadAndLaunchAppChromeRunning
-#else
-#define MAYBE_LoadAndLaunchAppChromeRunning LoadAndLaunchAppChromeRunning
-#endif
-
-// Case where Chrome is already running.
-IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
- MAYBE_LoadAndLaunchAppChromeRunning) {
- ExtensionTestMessageListener launched_listener("Launched", false);
-
- const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
- CommandLine new_cmdline(cmdline.GetProgram());
-
- const char* kSwitchNames[] = {
- switches::kUserDataDir,
- };
- new_cmdline.CopySwitchesFrom(cmdline, kSwitchNames, arraysize(kSwitchNames));
-
- base::FilePath app_path = test_data_dir_
- .AppendASCII("platform_apps")
- .AppendASCII("minimal");
-
- new_cmdline.AppendSwitchNative(switches::kLoadAndLaunchApp,
- app_path.value());
-
- new_cmdline.AppendSwitch(content::kLaunchAsBrowser);
- base::ProcessHandle process;
- base::LaunchProcess(new_cmdline, base::LaunchOptions(), &process);
- ASSERT_NE(base::kNullProcessHandle, process);
-
- ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
- ASSERT_TRUE(base::WaitForSingleProcess(
- process, TestTimeouts::action_timeout()));
-}
-
-namespace {
-
-// TestFixture that appends --load-and-launch-app before calling BrowserMain.
-class PlatformAppLoadAndLaunchBrowserTest : public PlatformAppBrowserTest {
- protected:
- PlatformAppLoadAndLaunchBrowserTest() {}
-
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
- PlatformAppBrowserTest::SetUpCommandLine(command_line);
- app_path_ = test_data_dir_
- .AppendASCII("platform_apps")
- .AppendASCII("minimal");
- command_line->AppendSwitchNative(switches::kLoadAndLaunchApp,
- app_path_.value());
- }
-
- void LoadAndLaunchApp() {
- ExtensionTestMessageListener launched_listener("Launched", false);
- ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
-
- // Start an actual browser because we can't shut down with just an app
- // window.
- CreateBrowser(ProfileManager::GetDefaultProfile());
- }
-
- private:
- base::FilePath app_path_;
-
- DISALLOW_COPY_AND_ASSIGN(PlatformAppLoadAndLaunchBrowserTest);
-};
-
-} // namespace
-
-
-// TODO(jackhou): Make this test not flaky on Vista. See http://crbug.com/176897
-#if defined(OS_WIN)
-#define MAYBE_LoadAndLaunchAppChromeNotRunning \
- DISABLED_LoadAndLaunchAppChromeNotRunning
-#else
-#define MAYBE_LoadAndLaunchAppChromeNotRunning \
- LoadAndLaunchAppChromeNotRunning
-#endif
-
-// Case where Chrome is not running.
-IN_PROC_BROWSER_TEST_F(PlatformAppLoadAndLaunchBrowserTest,
- MAYBE_LoadAndLaunchAppChromeNotRunning) {
- LoadAndLaunchApp();
-}
-
-} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_system.cc ('k') | chrome/browser/extensions/platform_app_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698