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

Unified Diff: extensions/common/features/simple_feature_unittest.cc

Issue 1054813002: Refactor ScopedCommandLineSwitch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@whitelisted
Patch Set: Created 5 years, 9 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: extensions/common/features/simple_feature_unittest.cc
diff --git a/extensions/common/features/simple_feature_unittest.cc b/extensions/common/features/simple_feature_unittest.cc
index 528c56571b886a2bef1eac187e0cbadd3fcc330b..85b8bbe67d609beca39bb56130012e191c39a441 100644
--- a/extensions/common/features/simple_feature_unittest.cc
+++ b/extensions/common/features/simple_feature_unittest.cc
@@ -10,6 +10,7 @@
#include "base/stl_util.h"
#include "base/values.h"
#include "extensions/common/manifest.h"
+#include "extensions/common/test/scoped_command_line_switch.h"
#include "extensions/common/value_builder.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,21 +27,6 @@ struct IsAvailableTestData {
Feature::AvailabilityResult expected_result;
};
-class ScopedCommandLineSwitch {
- public:
- explicit ScopedCommandLineSwitch(const std::string& arg)
- : original_command_line_(*base::CommandLine::ForCurrentProcess()) {
- base::CommandLine::ForCurrentProcess()->AppendSwitch(arg);
- }
-
- ~ScopedCommandLineSwitch() {
- *base::CommandLine::ForCurrentProcess() = original_command_line_;
- }
-
- private:
- base::CommandLine original_command_line_;
-};
-
} // namespace
class SimpleFeatureTest : public testing::Test {

Powered by Google App Engine
This is Rietveld 408576698