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

Side by Side Diff: chrome/test/base/scoped_testing_local_state.cc

Issue 12223091: Split testing_pref_service.h/.cc into two parts, generic vs. Chrome-specific. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/test/base/scoped_testing_local_state.h"
6
7 #include "chrome/browser/prefs/browser_prefs.h"
8 #include "chrome/test/base/testing_browser_process.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 ScopedTestingLocalState::ScopedTestingLocalState(
12 TestingBrowserProcess* browser_process)
13 : browser_process_(browser_process) {
14 chrome::RegisterLocalState(&local_state_, local_state_.registry());
15 EXPECT_FALSE(browser_process->local_state());
16 browser_process->SetLocalState(&local_state_);
17 }
18
19 ScopedTestingLocalState::~ScopedTestingLocalState() {
20 EXPECT_EQ(&local_state_, browser_process_->local_state());
21 browser_process_->SetLocalState(NULL);
22 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698