Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chrome/browser/chromeos/extensions/echo_private_apitest.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "chrome/browser/chromeos/settings/cros_settings.h" 10 #include "chrome/browser/chromeos/settings/cros_settings.h"
(...skipping 30 matching lines...) Expand all
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(
48 &ExtensionEchoPrivateApiTest::OnDialogShown, this))); 48 &ExtensionEchoPrivateApiTest::OnDialogShown, this)));
49 function->set_has_callback(true); 49 function->set_has_callback(true);
50 50
51 scoped_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult( 51 std::unique_ptr<base::Value> result(utils::RunFunctionAndReturnSingleResult(
52 function.get(), 52 function.get(),
53 "[{\"serviceName\":\"some_name\",\"origin\":\"http://chromium.org\"}]", 53 "[{\"serviceName\":\"some_name\",\"origin\":\"http://chromium.org\"}]",
54 browser())); 54 browser()));
55 55
56 ASSERT_TRUE(result.get()); 56 ASSERT_TRUE(result.get());
57 ASSERT_EQ(base::Value::TYPE_BOOLEAN, result->GetType()); 57 ASSERT_EQ(base::Value::TYPE_BOOLEAN, result->GetType());
58 58
59 bool result_as_boolean = false; 59 bool result_as_boolean = false;
60 ASSERT_TRUE(result->GetAsBoolean(&result_as_boolean)); 60 ASSERT_TRUE(result->GetAsBoolean(&result_as_boolean));
61 61
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/echo_private_api.cc ('k') | chrome/browser/chromeos/extensions/external_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698