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

Unified Diff: chrome/browser/bookmarks/bookmark_model_unittest.cc

Issue 8561031: Replace ScopedCommandLineOverride with TestSuite listener. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/bookmarks/bookmark_model_unittest.cc
diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc
index b3cb34c16cec26278458cac7dfaefd463ff38446..a738030a32d5c673df533764857c4edab8900e13 100644
--- a/chrome/browser/bookmarks/bookmark_model_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc
@@ -7,7 +7,6 @@
#include "base/base_paths.h"
#include "base/basictypes.h"
-#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/file_util.h"
#include "base/hash_tables.h"
@@ -26,6 +25,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/model_test_utils.h"
+#include "chrome/test/base/scoped_command_line_override.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_registrar.h"
@@ -88,16 +88,11 @@ class BookmarkModelTest : public testing::Test,
};
BookmarkModelTest()
- : model_(NULL),
- original_command_line_(*CommandLine::ForCurrentProcess()) {
+ : model_(NULL) {
model_.AddObserver(this);
ClearCounts();
}
- virtual void TearDown() OVERRIDE {
- *CommandLine::ForCurrentProcess() = original_command_line_;
- }
-
void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE {
// We never load from the db, so that this should never get invoked.
NOTREACHED();
@@ -167,8 +162,6 @@ class BookmarkModelTest : public testing::Test,
ObserverDetails observer_details_;
private:
- CommandLine original_command_line_;
-
int added_count_;
int moved_count_;
int removed_count_;
@@ -1029,8 +1022,7 @@ TEST_F(BookmarkModelTest, NodeVisibility) {
}
TEST_F(BookmarkModelTest, SyncNodeVisibileIfFlagSet) {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableSyncedBookmarksFolder);
+ ScopedCommandLineOverride override(switches::kEnableSyncedBookmarksFolder);
EXPECT_TRUE(model_.synced_node()->IsVisible());
}
« no previous file with comments | « no previous file | chrome/browser/history/top_sites_unittest.cc » ('j') | chrome/test/base/scoped_command_line_override.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698