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

Unified Diff: chrome/browser/chromeos/events/event_rewriter_unittest.cc

Issue 1908633002: Introduce ScopedCommandLine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update CrOS Unit Test 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/events/event_rewriter_unittest.cc
diff --git a/chrome/browser/chromeos/events/event_rewriter_unittest.cc b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
index dbab19f63042a9c67031e4c38e12c766a7df4d92..f00b1344368af92a1967e3a4d4db03fe3654b09d 100644
--- a/chrome/browser/chromeos/events/event_rewriter_unittest.cc
+++ b/chrome/browser/chromeos/events/event_rewriter_unittest.cc
@@ -15,6 +15,7 @@
#include "base/command_line.h"
#include "base/macros.h"
#include "base/strings/stringprintf.h"
+#include "base/test/command_line_test_util.h"
#include "chrome/browser/chromeos/input_method/input_method_configuration.h"
#include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
#include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
@@ -489,12 +490,10 @@ TEST_F(EventRewriterTest, TestRewriteNumPadKeys) {
TEST_F(EventRewriterTest, TestRewriteNumPadKeysWithDiamondKeyFlag) {
// Make sure the num lock works correctly even when Diamond key exists.
- const base::CommandLine original_cl(*base::CommandLine::ForCurrentProcess());
- base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
+ base::test::ScopedCommandLine scoped_command_line;
+ scoped_command_line.GetProcessCommandLine()->AppendSwitchASCII(
chromeos::switches::kHasChromeOSDiamondKey, "");
-
TestRewriteNumPadKeys();
- *base::CommandLine::ForCurrentProcess() = original_cl;
}
// Tests if the rewriter can handle a Command + Num Pad event.

Powered by Google App Engine
This is Rietveld 408576698