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/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "chrome/browser/chromeos/settings/cros_settings.h" | 10 #include "chrome/browser/chromeos/settings/cros_settings.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 base::Bind(&ExtensionEchoPrivateApiTest::OnDialogShown, | 48 base::Bind(&ExtensionEchoPrivateApiTest::OnDialogShown, |
49 base::Unretained(this)))); | 49 base::Unretained(this)))); |
50 function->set_has_callback(true); | 50 function->set_has_callback(true); |
51 | 51 |
52 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( | 52 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( |
53 function.get(), | 53 function.get(), |
54 "[{\"serviceName\":\"some_name\",\"origin\":\"http://chromium.org\"}]", | 54 "[{\"serviceName\":\"some_name\",\"origin\":\"http://chromium.org\"}]", |
55 browser())); | 55 browser())); |
56 | 56 |
57 ASSERT_TRUE(result.get()); | 57 ASSERT_TRUE(result.get()); |
58 ASSERT_EQ(base::Value::TYPE_BOOLEAN, result->GetType()); | 58 ASSERT_EQ(base::Value::Type::BOOLEAN, result->GetType()); |
59 | 59 |
60 bool result_as_boolean = false; | 60 bool result_as_boolean = false; |
61 ASSERT_TRUE(result->GetAsBoolean(&result_as_boolean)); | 61 ASSERT_TRUE(result->GetAsBoolean(&result_as_boolean)); |
62 | 62 |
63 EXPECT_EQ(expected_result, result_as_boolean); | 63 EXPECT_EQ(expected_result, result_as_boolean); |
64 } | 64 } |
65 | 65 |
66 void OnDialogShown(chromeos::EchoDialogView* dialog) { | 66 void OnDialogShown(chromeos::EchoDialogView* dialog) { |
67 dialog_invocation_count_++; | 67 dialog_invocation_count_++; |
68 ASSERT_LE(dialog_invocation_count_, 1); | 68 ASSERT_LE(dialog_invocation_count_, 1); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 expected_dialog_buttons_ = ui::DIALOG_BUTTON_CANCEL; | 174 expected_dialog_buttons_ = ui::DIALOG_BUTTON_CANCEL; |
175 dialog_action_ = DIALOG_TEST_ACTION_CANCEL; | 175 dialog_action_ = DIALOG_TEST_ACTION_CANCEL; |
176 | 176 |
177 RunDefaultGetUserFunctionAndExpectResultEquals(false); | 177 RunDefaultGetUserFunctionAndExpectResultEquals(false); |
178 | 178 |
179 EXPECT_EQ(1, dialog_invocation_count()); | 179 EXPECT_EQ(1, dialog_invocation_count()); |
180 } | 180 } |
181 | 181 |
182 } // namespace chromeos | 182 } // namespace chromeos |
OLD | NEW |