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 11 matching lines...) Expand all Loading... |
22 EXPECT_TRUE(RunComponentExtensionTest( | 22 EXPECT_TRUE(RunComponentExtensionTest( |
23 "system/get_incognito_mode_availability")) << message_; | 23 "system/get_incognito_mode_availability")) << message_; |
24 } | 24 } |
25 | 25 |
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 fake_update_engine_client_ = new chromeos::FakeUpdateEngineClient; | 34 fake_update_engine_client_ = new chromeos::FakeUpdateEngineClient; |
35 chromeos::DBusThreadManager::GetSetterForTesting()->SetUpdateEngineClient( | 35 chromeos::DBusThreadManager::GetSetterForTesting()->SetUpdateEngineClient( |
36 scoped_ptr<UpdateEngineClient>(fake_update_engine_client_)); | 36 scoped_ptr<UpdateEngineClient>(fake_update_engine_client_)); |
37 } | 37 } |
38 | 38 |
39 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 39 virtual void TearDownInProcessBrowserTestFixture() override { |
40 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); | 40 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); |
41 } | 41 } |
42 | 42 |
43 protected: | 43 protected: |
44 chromeos::FakeUpdateEngineClient* fake_update_engine_client_; | 44 chromeos::FakeUpdateEngineClient* fake_update_engine_client_; |
45 | 45 |
46 private: | 46 private: |
47 DISALLOW_COPY_AND_ASSIGN(GetUpdateStatusApiTest); | 47 DISALLOW_COPY_AND_ASSIGN(GetUpdateStatusApiTest); |
48 }; | 48 }; |
49 | 49 |
(...skipping 10 matching lines...) Expand all Loading... |
60 // The fake client returns the last status in this order. | 60 // The fake client returns the last status in this order. |
61 fake_update_engine_client_->PushLastStatus(status_not_available); | 61 fake_update_engine_client_->PushLastStatus(status_not_available); |
62 fake_update_engine_client_->PushLastStatus(status_updating); | 62 fake_update_engine_client_->PushLastStatus(status_updating); |
63 fake_update_engine_client_->PushLastStatus(status_boot_needed); | 63 fake_update_engine_client_->PushLastStatus(status_boot_needed); |
64 | 64 |
65 ASSERT_TRUE(RunComponentExtensionTest( | 65 ASSERT_TRUE(RunComponentExtensionTest( |
66 "system/get_update_status")) << message_; | 66 "system/get_update_status")) << message_; |
67 } | 67 } |
68 | 68 |
69 #endif | 69 #endif |
OLD | NEW |