| 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/app_window.h" | 5 #include "apps/app_window.h" |
| 6 #include "apps/app_window_registry.h" | 6 #include "apps/app_window_registry.h" |
| 7 #include "apps/launcher.h" | 7 #include "apps/launcher.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.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 #include "extensions/browser/pref_names.h" | 45 #include "extensions/browser/pref_names.h" |
| 46 #include "extensions/common/api/app_runtime.h" | 46 #include "extensions/common/api/app_runtime.h" |
| 47 #include "net/test/embedded_test_server/embedded_test_server.h" | 47 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 48 #include "url/gurl.h" | 48 #include "url/gurl.h" |
| 49 | 49 |
| 50 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
| 51 #include "base/memory/scoped_ptr.h" | 51 #include "base/memory/scoped_ptr.h" |
| 52 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" | 52 #include "chrome/browser/chromeos/login/users/mock_user_manager.h" |
| 53 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 53 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 54 #include "chromeos/dbus/dbus_thread_manager.h" | 54 #include "chromeos/dbus/dbus_thread_manager.h" |
| 55 #include "chromeos/dbus/fake_dbus_thread_manager.h" | |
| 56 #include "chromeos/dbus/fake_power_manager_client.h" | 55 #include "chromeos/dbus/fake_power_manager_client.h" |
| 57 #endif | 56 #endif |
| 58 | 57 |
| 59 using apps::AppWindow; | 58 using apps::AppWindow; |
| 60 using apps::AppWindowRegistry; | 59 using apps::AppWindowRegistry; |
| 61 using content::WebContents; | 60 using content::WebContents; |
| 62 using web_modal::WebContentsModalDialogManager; | 61 using web_modal::WebContentsModalDialogManager; |
| 63 | 62 |
| 64 namespace app_runtime = extensions::core_api::app_runtime; | 63 namespace app_runtime = extensions::core_api::app_runtime; |
| 65 | 64 |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 public: | 1222 public: |
| 1224 RestartDeviceTest() | 1223 RestartDeviceTest() |
| 1225 : power_manager_client_(NULL), | 1224 : power_manager_client_(NULL), |
| 1226 mock_user_manager_(NULL) {} | 1225 mock_user_manager_(NULL) {} |
| 1227 virtual ~RestartDeviceTest() {} | 1226 virtual ~RestartDeviceTest() {} |
| 1228 | 1227 |
| 1229 // PlatformAppBrowserTest overrides | 1228 // PlatformAppBrowserTest overrides |
| 1230 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 1229 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 1231 PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture(); | 1230 PlatformAppBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 1232 | 1231 |
| 1233 chromeos::FakeDBusThreadManager* dbus_manager = | |
| 1234 new chromeos::FakeDBusThreadManager; | |
| 1235 dbus_manager->SetFakeClients(); | |
| 1236 power_manager_client_ = new chromeos::FakePowerManagerClient; | 1232 power_manager_client_ = new chromeos::FakePowerManagerClient; |
| 1237 dbus_manager->SetPowerManagerClient( | 1233 chromeos::DBusThreadManager::GetSetterForTesting()->SetPowerManagerClient( |
| 1238 scoped_ptr<chromeos::PowerManagerClient>(power_manager_client_)); | 1234 scoped_ptr<chromeos::PowerManagerClient>(power_manager_client_)); |
| 1239 chromeos::DBusThreadManager::SetInstanceForTesting(dbus_manager); | |
| 1240 } | 1235 } |
| 1241 | 1236 |
| 1242 virtual void SetUpOnMainThread() OVERRIDE { | 1237 virtual void SetUpOnMainThread() OVERRIDE { |
| 1243 PlatformAppBrowserTest::SetUpOnMainThread(); | 1238 PlatformAppBrowserTest::SetUpOnMainThread(); |
| 1244 | 1239 |
| 1245 mock_user_manager_ = new chromeos::MockUserManager; | 1240 mock_user_manager_ = new chromeos::MockUserManager; |
| 1246 user_manager_enabler_.reset( | 1241 user_manager_enabler_.reset( |
| 1247 new chromeos::ScopedUserManagerEnabler(mock_user_manager_)); | 1242 new chromeos::ScopedUserManagerEnabler(mock_user_manager_)); |
| 1248 | 1243 |
| 1249 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) | 1244 EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 LoadAndLaunchPlatformApp("reinstall_data_cleanup", "Launched"); | 1315 LoadAndLaunchPlatformApp("reinstall_data_cleanup", "Launched"); |
| 1321 ASSERT_TRUE(extension); | 1316 ASSERT_TRUE(extension); |
| 1322 ASSERT_EQ(extension_id, extension->id()); | 1317 ASSERT_EQ(extension_id, extension->id()); |
| 1323 | 1318 |
| 1324 ExtensionApiTest::ResultCatcher result_catcher; | 1319 ExtensionApiTest::ResultCatcher result_catcher; |
| 1325 EXPECT_TRUE(result_catcher.GetNextResult()); | 1320 EXPECT_TRUE(result_catcher.GetNextResult()); |
| 1326 } | 1321 } |
| 1327 } | 1322 } |
| 1328 | 1323 |
| 1329 } // namespace extensions | 1324 } // namespace extensions |
| OLD | NEW |