New issue
Advanced search Search tips

Issue 604961 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 8
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Add ScopedCommandLine for Tests

Project Member Reported by robliao@chromium.org, Apr 20 2016

Issue description

Tests occasionally need to set and restore the command line for tests. A utility class would be helpful for test.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/48e31159a123a0f7e3f3e45b7e28a136408ddf3a

commit 48e31159a123a0f7e3f3e45b7e28a136408ddf3a
Author: robliao <robliao@chromium.org>
Date: Fri Apr 29 20:29:31 2016

Introduce ScopedCommandLine

A few tests other there have the need to manipulate the command line and
restore it after the test. ScopedCommandLine provides an easy way to
set the options you need and then restore them when the ScopedCommandLine
is out of scope.

This also cleans up some other tests that were storing away the command line. This is unnecessary as the test infrastructure cleans this up (see TestClientInitializer)

BUG= 604961 

Review-Url: https://codereview.chromium.org/1908633002
Cr-Commit-Position: refs/heads/master@{#390741}

[modify] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/base/base.gyp
[modify] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/base/test/BUILD.gn
[add] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/base/test/scoped_command_line.cc
[add] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/base/test/scoped_command_line.h
[modify] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/chrome/browser/chromeos/events/event_rewriter_unittest.cc
[modify] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/chrome/browser/extensions/activity_log/activity_log_enabled_unittest.cc
[modify] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/chrome/browser/extensions/activity_log/counting_policy_unittest.cc
[modify] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/chrome/browser/extensions/activity_log/fullstream_ui_policy_unittest.cc
[modify] https://crrev.com/48e31159a123a0f7e3f3e45b7e28a136408ddf3a/extensions/common/features/simple_feature_unittest.cc

Status: Fixed (was: Started)
Closing this for now as the primary body of work is done.

Sign in to add a comment