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 "apps/launcher.h" | 5 #include "apps/launcher.h" |
6 #include "apps/shell_window.h" | 6 #include "apps/shell_window.h" |
7 #include "apps/shell_window_registry.h" | 7 #include "apps/shell_window_registry.h" |
8 #include "apps/ui/native_app_window.h" | 8 #include "apps/ui/native_app_window.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1244 // PlatformAppBrowserTest overrides | 1244 // PlatformAppBrowserTest overrides |
1245 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 1245 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
1246 PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture(); | 1246 PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture(); |
1247 | 1247 |
1248 chromeos::FakeDBusThreadManager* dbus_manager = | 1248 chromeos::FakeDBusThreadManager* dbus_manager = |
1249 new chromeos::FakeDBusThreadManager; | 1249 new chromeos::FakeDBusThreadManager; |
1250 dbus_manager->SetFakeClients(); | 1250 dbus_manager->SetFakeClients(); |
1251 power_manager_client_ = new chromeos::FakePowerManagerClient; | 1251 power_manager_client_ = new chromeos::FakePowerManagerClient; |
1252 dbus_manager->SetPowerManagerClient( | 1252 dbus_manager->SetPowerManagerClient( |
1253 scoped_ptr<chromeos::PowerManagerClient>(power_manager_client_)); | 1253 scoped_ptr<chromeos::PowerManagerClient>(power_manager_client_)); |
1254 chromeos::DBusThreadManager::InitializeForTesting(dbus_manager); | 1254 chromeos::DBusThreadManager::SetInstanceForTesting(dbus_manager); |
1255 } | 1255 } |
1256 | 1256 |
1257 virtual void SetUpOnMainThread() OVERRIDE { | 1257 virtual void SetUpOnMainThread() OVERRIDE { |
1258 PlatformAppBrowserTest::SetUpOnMainThread(); | 1258 PlatformAppBrowserTest::SetUpOnMainThread(); |
1259 | 1259 |
1260 mock_user_manager_ = new chromeos::MockUserManager; | 1260 mock_user_manager_ = new chromeos::MockUserManager; |
1261 user_manager_enabler_.reset( | 1261 user_manager_enabler_.reset( |
1262 new chromeos::ScopedUserManagerEnabler(mock_user_manager_)); | 1262 new chromeos::ScopedUserManagerEnabler(mock_user_manager_)); |
1263 | 1263 |
1264 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) | 1264 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) |
1265 .WillRepeatedly(testing::Return(true)); | 1265 .WillRepeatedly(testing::Return(true)); |
1266 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsKioskApp()) | 1266 EXPECT_CALL(*mock_user_manager_, IsLoggedInAsKioskApp()) |
1267 .WillRepeatedly(testing::Return(true)); | 1267 .WillRepeatedly(testing::Return(true)); |
1268 } | 1268 } |
1269 | 1269 |
1270 virtual void CleanUpOnMainThread() OVERRIDE { | 1270 virtual void CleanUpOnMainThread() OVERRIDE { |
1271 user_manager_enabler_.reset(); | 1271 user_manager_enabler_.reset(); |
1272 PlatformAppBrowserTest::CleanUpOnMainThread(); | 1272 PlatformAppBrowserTest::CleanUpOnMainThread(); |
1273 } | 1273 } |
1274 | 1274 |
1275 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 1275 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
1276 chromeos::DBusThreadManager::Shutdown(); | |
satorux1
2013/11/27 03:27:17
Is it ok to remove this? I thought FakeDBusThreadM
oshima
2013/11/27 07:41:54
Yes, this wasn't necessary because Shutdown is cal
| |
1277 PlatformAppBrowserTest::TearDownInProcessBrowserTestFixture(); | 1276 PlatformAppBrowserTest::TearDownInProcessBrowserTestFixture(); |
1278 } | 1277 } |
1279 | 1278 |
1280 int request_restart_call_count() const { | 1279 int request_restart_call_count() const { |
1281 return power_manager_client_->request_restart_call_count(); | 1280 return power_manager_client_->request_restart_call_count(); |
1282 } | 1281 } |
1283 | 1282 |
1284 private: | 1283 private: |
1285 chromeos::FakePowerManagerClient* power_manager_client_; | 1284 chromeos::FakePowerManagerClient* power_manager_client_; |
1286 chromeos::MockUserManager* mock_user_manager_; | 1285 chromeos::MockUserManager* mock_user_manager_; |
(...skipping 17 matching lines...) Expand all Loading... | |
1304 false); | 1303 false); |
1305 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); | 1304 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); |
1306 | 1305 |
1307 EXPECT_EQ(1, request_restart_call_count()); | 1306 EXPECT_EQ(1, request_restart_call_count()); |
1308 } | 1307 } |
1309 | 1308 |
1310 #endif // defined(OS_CHROMEOS) | 1309 #endif // defined(OS_CHROMEOS) |
1311 | 1310 |
1312 | 1311 |
1313 } // namespace extensions | 1312 } // namespace extensions |
OLD | NEW |