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

Side by Side Diff: chrome/browser/chromeos/login/enable_debugging_browsertest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 void SetUpCommandLine(base::CommandLine* command_line) override { 169 void SetUpCommandLine(base::CommandLine* command_line) override {
170 LoginManagerTest::SetUpCommandLine(command_line); 170 LoginManagerTest::SetUpCommandLine(command_line);
171 command_line->AppendSwitch(chromeos::switches::kSystemDevMode); 171 command_line->AppendSwitch(chromeos::switches::kSystemDevMode);
172 // Disable HID detection because it takes precedence and could block 172 // Disable HID detection because it takes precedence and could block
173 // enable-debugging UI. 173 // enable-debugging UI.
174 command_line->AppendSwitch(chromeos::switches::kDisableHIDDetectionOnOOBE); 174 command_line->AppendSwitch(chromeos::switches::kDisableHIDDetectionOnOOBE);
175 } 175 }
176 176
177 // LoginManagerTest overrides: 177 // LoginManagerTest overrides:
178 void SetUpInProcessBrowserTestFixture() override { 178 void SetUpInProcessBrowserTestFixture() override {
179 scoped_ptr<DBusThreadManagerSetter> dbus_setter = 179 std::unique_ptr<DBusThreadManagerSetter> dbus_setter =
180 chromeos::DBusThreadManager::GetSetterForTesting(); 180 chromeos::DBusThreadManager::GetSetterForTesting();
181 power_manager_client_ = new FakePowerManagerClient; 181 power_manager_client_ = new FakePowerManagerClient;
182 dbus_setter->SetPowerManagerClient( 182 dbus_setter->SetPowerManagerClient(
183 scoped_ptr<PowerManagerClient>(power_manager_client_)); 183 std::unique_ptr<PowerManagerClient>(power_manager_client_));
184 debug_daemon_client_ = new TestDebugDaemonClient; 184 debug_daemon_client_ = new TestDebugDaemonClient;
185 dbus_setter->SetDebugDaemonClient( 185 dbus_setter->SetDebugDaemonClient(
186 scoped_ptr<DebugDaemonClient>(debug_daemon_client_)); 186 std::unique_ptr<DebugDaemonClient>(debug_daemon_client_));
187 187
188 LoginManagerTest::SetUpInProcessBrowserTestFixture(); 188 LoginManagerTest::SetUpInProcessBrowserTestFixture();
189 } 189 }
190 190
191 bool JSExecuted(const std::string& script) { 191 bool JSExecuted(const std::string& script) {
192 return content::ExecuteScript(web_contents(), script); 192 return content::ExecuteScript(web_contents(), script);
193 } 193 }
194 194
195 void WaitUntilJSIsReady() { 195 void WaitUntilJSIsReady() {
196 LoginDisplayHost* host = LoginDisplayHost::default_host(); 196 LoginDisplayHost* host = LoginDisplayHost::default_host();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 EnableDebuggingNonDevTest() { 347 EnableDebuggingNonDevTest() {
348 } 348 }
349 349
350 void SetUpCommandLine(base::CommandLine* command_line) override { 350 void SetUpCommandLine(base::CommandLine* command_line) override {
351 // Skip EnableDebuggingTest::SetUpCommandLine(). 351 // Skip EnableDebuggingTest::SetUpCommandLine().
352 LoginManagerTest::SetUpCommandLine(command_line); 352 LoginManagerTest::SetUpCommandLine(command_line);
353 } 353 }
354 354
355 // LoginManagerTest overrides: 355 // LoginManagerTest overrides:
356 void SetUpInProcessBrowserTestFixture() override { 356 void SetUpInProcessBrowserTestFixture() override {
357 scoped_ptr<DBusThreadManagerSetter> dbus_setter = 357 std::unique_ptr<DBusThreadManagerSetter> dbus_setter =
358 chromeos::DBusThreadManager::GetSetterForTesting(); 358 chromeos::DBusThreadManager::GetSetterForTesting();
359 dbus_setter->SetDebugDaemonClient( 359 dbus_setter->SetDebugDaemonClient(
360 scoped_ptr<DebugDaemonClient>(new FakeDebugDaemonClient)); 360 std::unique_ptr<DebugDaemonClient>(new FakeDebugDaemonClient));
361 LoginManagerTest::SetUpInProcessBrowserTestFixture(); 361 LoginManagerTest::SetUpInProcessBrowserTestFixture();
362 } 362 }
363 }; 363 };
364 364
365 // Try to show enable debugging dialog, we should see error screen here. 365 // Try to show enable debugging dialog, we should see error screen here.
366 IN_PROC_BROWSER_TEST_F(EnableDebuggingNonDevTest, NoShowInNonDevMode) { 366 IN_PROC_BROWSER_TEST_F(EnableDebuggingNonDevTest, NoShowInNonDevMode) {
367 JSExpect("!!document.querySelector('#debugging.hidden')"); 367 JSExpect("!!document.querySelector('#debugging.hidden')");
368 InvokeEnableDebuggingScreen(); 368 InvokeEnableDebuggingScreen();
369 JSExpect("!document.querySelector('#debugging.hidden')"); 369 JSExpect("!document.querySelector('#debugging.hidden')");
370 base::MessageLoop::current()->RunUntilIdle(); 370 base::MessageLoop::current()->RunUntilIdle();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 } 408 }
409 409
410 // Canceling auto shown setup screen should close it. 410 // Canceling auto shown setup screen should close it.
411 IN_PROC_BROWSER_TEST_F(EnableDebuggingRequestedTest, CancelAutoShowSetup) { 411 IN_PROC_BROWSER_TEST_F(EnableDebuggingRequestedTest, CancelAutoShowSetup) {
412 OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING).Wait(); 412 OobeScreenWaiter(OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING).Wait();
413 CloseEnableDebuggingScreen(); 413 CloseEnableDebuggingScreen();
414 JSExpect("!!document.querySelector('#debugging.hidden')"); 414 JSExpect("!!document.querySelector('#debugging.hidden')");
415 } 415 }
416 416
417 } // namespace chromeos 417 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698