OLD | NEW |
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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 extensions::PlatformAppBrowserTest::SetUpOnMainThread(); | 45 extensions::PlatformAppBrowserTest::SetUpOnMainThread(); |
46 | 46 |
47 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 47 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
48 const base::FilePath& temp_dir = temp_dir_.path(); | 48 const base::FilePath& temp_dir = temp_dir_.path(); |
49 | 49 |
50 const base::TimeDelta uptime = base::TimeDelta::FromHours(1); | 50 const base::TimeDelta uptime = base::TimeDelta::FromHours(1); |
51 const std::string uptime_seconds = | 51 const std::string uptime_seconds = |
52 base::DoubleToString(uptime.InSecondsF()); | 52 base::DoubleToString(uptime.InSecondsF()); |
53 const base::FilePath uptime_file = temp_dir.Append("uptime"); | 53 const base::FilePath uptime_file = temp_dir.Append("uptime"); |
54 ASSERT_EQ(static_cast<int>(uptime_seconds.size()), | 54 ASSERT_EQ(static_cast<int>(uptime_seconds.size()), |
55 file_util::WriteFile( | 55 base::WriteFile( |
56 uptime_file, uptime_seconds.c_str(), uptime_seconds.size())); | 56 uptime_file, uptime_seconds.c_str(), uptime_seconds.size())); |
57 uptime_file_override_.reset( | 57 uptime_file_override_.reset( |
58 new base::ScopedPathOverride(chromeos::FILE_UPTIME, uptime_file)); | 58 new base::ScopedPathOverride(chromeos::FILE_UPTIME, uptime_file)); |
59 | 59 |
60 app_ = LoadExtension( | 60 app_ = LoadExtension( |
61 test_data_dir_.AppendASCII("api_test/runtime/on_restart_required")); | 61 test_data_dir_.AppendASCII("api_test/runtime/on_restart_required")); |
62 | 62 |
63 // Fake app mode command line. | 63 // Fake app mode command line. |
64 CommandLine* command = CommandLine::ForCurrentProcess(); | 64 CommandLine* command = CommandLine::ForCurrentProcess(); |
65 command->AppendSwitch(switches::kForceAppMode); | 65 command->AppendSwitch(switches::kForceAppMode); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 IN_PROC_BROWSER_TEST_F(KioskAppUpdateServiceTest, Periodic) { | 110 IN_PROC_BROWSER_TEST_F(KioskAppUpdateServiceTest, Periodic) { |
111 g_browser_process->local_state()->SetInteger( | 111 g_browser_process->local_state()->SetInteger( |
112 prefs::kUptimeLimit, base::TimeDelta::FromMinutes(30).InSeconds()); | 112 prefs::kUptimeLimit, base::TimeDelta::FromMinutes(30).InSeconds()); |
113 | 113 |
114 ExtensionTestMessageListener listener("periodic", false); | 114 ExtensionTestMessageListener listener("periodic", false); |
115 listener.WaitUntilSatisfied(); | 115 listener.WaitUntilSatisfied(); |
116 } | 116 } |
117 | 117 |
118 } // namespace chromeos | 118 } // namespace chromeos |
OLD | NEW |