| 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 "chrome/browser/chromeos/extensions/echo_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/echo_private_api.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "chrome/browser/chromeos/settings/cros_settings.h" | 10 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 ExtensionEchoPrivateApiTest() | 29 ExtensionEchoPrivateApiTest() |
| 30 : expected_dialog_buttons_(ui::DIALOG_BUTTON_NONE), | 30 : expected_dialog_buttons_(ui::DIALOG_BUTTON_NONE), |
| 31 dialog_action_(DIALOG_TEST_ACTION_NONE), | 31 dialog_action_(DIALOG_TEST_ACTION_NONE), |
| 32 dialog_invocation_count_(0) { | 32 dialog_invocation_count_(0) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 virtual ~ExtensionEchoPrivateApiTest() {} | 35 virtual ~ExtensionEchoPrivateApiTest() {} |
| 36 | 36 |
| 37 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 37 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 38 ExtensionApiTest::SetUpCommandLine(command_line); | 38 ExtensionApiTest::SetUpCommandLine(command_line); |
| 39 | 39 |
| 40 // Force usage of stub cros settings provider instead of device settings | 40 // Force usage of stub cros settings provider instead of device settings |
| 41 // provider. | 41 // provider. |
| 42 command_line->AppendSwitch(switches::kStubCrosSettings); | 42 command_line->AppendSwitch(switches::kStubCrosSettings); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void RunDefaultGetUserFunctionAndExpectResultEquals(bool expected_result) { | 45 void RunDefaultGetUserFunctionAndExpectResultEquals(bool expected_result) { |
| 46 scoped_refptr<EchoPrivateGetUserConsentFunction> function( | 46 scoped_refptr<EchoPrivateGetUserConsentFunction> function( |
| 47 EchoPrivateGetUserConsentFunction::CreateForTest(base::Bind( | 47 EchoPrivateGetUserConsentFunction::CreateForTest(base::Bind( |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 expected_dialog_buttons_ = ui::DIALOG_BUTTON_CANCEL; | 173 expected_dialog_buttons_ = ui::DIALOG_BUTTON_CANCEL; |
| 174 dialog_action_ = DIALOG_TEST_ACTION_CANCEL; | 174 dialog_action_ = DIALOG_TEST_ACTION_CANCEL; |
| 175 | 175 |
| 176 RunDefaultGetUserFunctionAndExpectResultEquals(false); | 176 RunDefaultGetUserFunctionAndExpectResultEquals(false); |
| 177 | 177 |
| 178 EXPECT_EQ(1, dialog_invocation_count()); | 178 EXPECT_EQ(1, dialog_invocation_count()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace chromeos | 181 } // namespace chromeos |
| OLD | NEW |