| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" |
| 7 #include "base/compiler_specific.h" |
| 8 #include "base/files/file_path.h" |
| 9 #include "base/path_service.h" |
| 10 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
| 11 #include "chrome/browser/extensions/extension_browsertest.h" |
| 12 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 13 #include "chrome/common/chrome_paths.h" |
| 14 #include "chromeos/chromeos_switches.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 |
| 17 namespace chromeos { |
| 18 |
| 19 class DemoAppLauncherTest : public ExtensionBrowserTest { |
| 20 public: |
| 21 DemoAppLauncherTest() { |
| 22 set_exit_when_last_browser_closes(false); |
| 23 } |
| 24 |
| 25 virtual ~DemoAppLauncherTest() {} |
| 26 |
| 27 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 28 command_line->AppendSwitch(switches::kLoginManager); |
| 29 command_line->AppendSwitch(switches::kForceLoginManagerInTests); |
| 30 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
| 31 |
| 32 command_line->AppendSwitchASCII(switches::kDerelictIdleTimeout, "0"); |
| 33 command_line->AppendSwitchASCII(switches::kOobeTimerInterval, "0"); |
| 34 command_line->AppendSwitchASCII(switches::kDerelictDetectionTimeout, "0"); |
| 35 } |
| 36 |
| 37 virtual void SetUp() OVERRIDE { |
| 38 chromeos::DemoAppLauncher::SetDemoAppPathForTesting(GetTestDemoAppPath()); |
| 39 InProcessBrowserTest::SetUp(); |
| 40 } |
| 41 |
| 42 base::FilePath GetTestDemoAppPath() const { |
| 43 base::FilePath test_data_dir; |
| 44 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)); |
| 45 return test_data_dir.Append(FILE_PATH_LITERAL("chromeos/demo_app")); |
| 46 } |
| 47 |
| 48 void VerifyDemoAppLaunch() { |
| 49 EXPECT_TRUE(ExtensionTestMessageListener("launchedDemoApp", |
| 50 false).WaitUntilSatisfied()); |
| 51 } |
| 52 |
| 53 private: |
| 54 DISALLOW_COPY_AND_ASSIGN(DemoAppLauncherTest); |
| 55 }; |
| 56 |
| 57 IN_PROC_BROWSER_TEST_F(DemoAppLauncherTest, Basic) { |
| 58 VerifyDemoAppLaunch(); |
| 59 } |
| 60 |
| 61 } // namespace chromeos |
| OLD | NEW |