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

Side by Side Diff: chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.cc

Issue 819133004: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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 "chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.h" 5 #include "chrome/browser/chromeos/login/screenshot_testing/screenshot_tester.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric.h" 10 #include "chrome/browser/chromeos/login/screenshot_testing/SkDiffPixelsMetric.h"
(...skipping 30 matching lines...) Expand all
41 ScreenshotTester::~ScreenshotTester() { 41 ScreenshotTester::~ScreenshotTester() {
42 } 42 }
43 43
44 ScreenshotTester::Result::Result() { 44 ScreenshotTester::Result::Result() {
45 } 45 }
46 46
47 ScreenshotTester::Result::~Result() { 47 ScreenshotTester::Result::~Result() {
48 } 48 }
49 49
50 bool ScreenshotTester::TryInitialize() { 50 bool ScreenshotTester::TryInitialize() {
51 CommandLine& command_line = *CommandLine::ForCurrentProcess(); 51 base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
52 if (!command_line.HasSwitch(switches::kEnableScreenshotTestingWithMode)) 52 if (!command_line.HasSwitch(switches::kEnableScreenshotTestingWithMode))
53 return false; 53 return false;
54 54
55 std::string mode = command_line.GetSwitchValueASCII( 55 std::string mode = command_line.GetSwitchValueASCII(
56 switches::kEnableScreenshotTestingWithMode); 56 switches::kEnableScreenshotTestingWithMode);
57 CHECK(mode == kUpdateMode || mode == kTestMode || mode == kPdiffTestMode) 57 CHECK(mode == kUpdateMode || mode == kTestMode || mode == kPdiffTestMode)
58 << "Invalid mode for screenshot testing: " << mode; 58 << "Invalid mode for screenshot testing: " << mode;
59 59
60 CHECK(command_line.HasSwitch(chromeos::switches::kGoldenScreenshotsDir)) 60 CHECK(command_line.HasSwitch(chromeos::switches::kGoldenScreenshotsDir))
61 << "No directory with golden screenshots specified, use " 61 << "No directory with golden screenshots specified, use "
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 ScreenshotTester::Result testing_result; 344 ScreenshotTester::Result testing_result;
345 testing_result.similarity = result.result; 345 testing_result.similarity = result.result;
346 testing_result.screenshots_match = 346 testing_result.screenshots_match =
347 (result.result == SkImageDiffer::RESULT_CORRECT); 347 (result.result == SkImageDiffer::RESULT_CORRECT);
348 348
349 return testing_result; 349 return testing_result;
350 } 350 }
351 351
352 } // namespace chromeos 352 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/screens/error_screen.cc ('k') | chrome/browser/chromeos/login/session/user_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698