| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
| 27 | 27 |
| 28 class GetUpdateStatusApiTest : public ExtensionApiTest { | 28 class GetUpdateStatusApiTest : public ExtensionApiTest { |
| 29 public: | 29 public: |
| 30 GetUpdateStatusApiTest() : fake_update_engine_client_(NULL) {} | 30 GetUpdateStatusApiTest() : fake_update_engine_client_(NULL) {} |
| 31 | 31 |
| 32 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 32 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 33 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 33 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 34 chromeos::FakeDBusThreadManager* fake_dbus_thread_manager = | 34 chromeos::FakeDBusThreadManager* fake_dbus_thread_manager = |
| 35 new chromeos::FakeDBusThreadManager; | 35 new chromeos::FakeDBusThreadManager; |
| 36 fake_update_engine_client_ = new chromeos::FakeUpdateEngineClient; |
| 37 fake_dbus_thread_manager->SetUpdateEngineClient( |
| 38 scoped_ptr<UpdateEngineClient>(fake_update_engine_client_)); |
| 36 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); | 39 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); |
| 37 fake_update_engine_client_ = | |
| 38 fake_dbus_thread_manager->fake_update_engine_client(); | |
| 39 } | 40 } |
| 40 | 41 |
| 41 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 42 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
| 42 chromeos::DBusThreadManager::Shutdown(); | 43 chromeos::DBusThreadManager::Shutdown(); |
| 43 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); | 44 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); |
| 44 } | 45 } |
| 45 | 46 |
| 46 protected: | 47 protected: |
| 47 chromeos::FakeUpdateEngineClient* fake_update_engine_client_; | 48 chromeos::FakeUpdateEngineClient* fake_update_engine_client_; |
| 48 | 49 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 63 // The fake client returns the last status in this order. | 64 // The fake client returns the last status in this order. |
| 64 fake_update_engine_client_->PushLastStatus(status_not_available); | 65 fake_update_engine_client_->PushLastStatus(status_not_available); |
| 65 fake_update_engine_client_->PushLastStatus(status_updating); | 66 fake_update_engine_client_->PushLastStatus(status_updating); |
| 66 fake_update_engine_client_->PushLastStatus(status_boot_needed); | 67 fake_update_engine_client_->PushLastStatus(status_boot_needed); |
| 67 | 68 |
| 68 ASSERT_TRUE(RunComponentExtensionTest( | 69 ASSERT_TRUE(RunComponentExtensionTest( |
| 69 "system/get_update_status")) << message_; | 70 "system/get_update_status")) << message_; |
| 70 } | 71 } |
| 71 | 72 |
| 72 #endif | 73 #endif |
| OLD | NEW |