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 19 matching lines...) Expand all Loading... |
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_dbus_thread_manager->SetFakeClients(); | 36 fake_dbus_thread_manager->SetFakeClients(); |
37 fake_update_engine_client_ = new chromeos::FakeUpdateEngineClient; | 37 fake_update_engine_client_ = new chromeos::FakeUpdateEngineClient; |
38 fake_dbus_thread_manager->SetUpdateEngineClient( | 38 fake_dbus_thread_manager->SetUpdateEngineClient( |
39 scoped_ptr<UpdateEngineClient>(fake_update_engine_client_)); | 39 scoped_ptr<UpdateEngineClient>(fake_update_engine_client_)); |
40 chromeos::DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager); | 40 chromeos::DBusThreadManager::SetInstanceForTesting( |
| 41 fake_dbus_thread_manager); |
41 } | 42 } |
42 | 43 |
43 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 44 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { |
44 chromeos::DBusThreadManager::Shutdown(); | |
45 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); | 45 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); |
46 } | 46 } |
47 | 47 |
48 protected: | 48 protected: |
49 chromeos::FakeUpdateEngineClient* fake_update_engine_client_; | 49 chromeos::FakeUpdateEngineClient* fake_update_engine_client_; |
50 | 50 |
51 private: | 51 private: |
52 DISALLOW_COPY_AND_ASSIGN(GetUpdateStatusApiTest); | 52 DISALLOW_COPY_AND_ASSIGN(GetUpdateStatusApiTest); |
53 }; | 53 }; |
54 | 54 |
(...skipping 10 matching lines...) Expand all Loading... |
65 // The fake client returns the last status in this order. | 65 // The fake client returns the last status in this order. |
66 fake_update_engine_client_->PushLastStatus(status_not_available); | 66 fake_update_engine_client_->PushLastStatus(status_not_available); |
67 fake_update_engine_client_->PushLastStatus(status_updating); | 67 fake_update_engine_client_->PushLastStatus(status_updating); |
68 fake_update_engine_client_->PushLastStatus(status_boot_needed); | 68 fake_update_engine_client_->PushLastStatus(status_boot_needed); |
69 | 69 |
70 ASSERT_TRUE(RunComponentExtensionTest( | 70 ASSERT_TRUE(RunComponentExtensionTest( |
71 "system/get_update_status")) << message_; | 71 "system/get_update_status")) << message_; |
72 } | 72 } |
73 | 73 |
74 #endif | 74 #endif |
OLD | NEW |