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

Side by Side Diff: chrome/browser/prefs/pref_service_browsertest.cc

Issue 925783002: Split ValueSerializer into separate Serializer and Deserializer classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed cpplint warnings. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 IN_PROC_BROWSER_TEST_F(PreferenceServiceTest, Test) { 94 IN_PROC_BROWSER_TEST_F(PreferenceServiceTest, Test) {
95 #if defined(OS_WIN) && defined(USE_ASH) 95 #if defined(OS_WIN) && defined(USE_ASH)
96 // Disable this test in Metro+Ash for now (http://crbug.com/262796). 96 // Disable this test in Metro+Ash for now (http://crbug.com/262796).
97 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 97 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
98 switches::kAshBrowserTests)) 98 switches::kAshBrowserTests))
99 return; 99 return;
100 #endif 100 #endif
101 101
102 // The window should open with the new reference profile, with window 102 // The window should open with the new reference profile, with window
103 // placement values stored in the user data directory. 103 // placement values stored in the user data directory.
104 JSONFileValueSerializer deserializer(original_pref_file_); 104 JSONFileValueDeserializer deserializer(original_pref_file_);
105 scoped_ptr<base::Value> root(deserializer.Deserialize(NULL, NULL)); 105 scoped_ptr<base::Value> root(deserializer.Deserialize(NULL, NULL));
106 106
107 ASSERT_TRUE(root.get()); 107 ASSERT_TRUE(root.get());
108 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); 108 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY));
109 109
110 base::DictionaryValue* root_dict = 110 base::DictionaryValue* root_dict =
111 static_cast<base::DictionaryValue*>(root.get()); 111 static_cast<base::DictionaryValue*>(root.get());
112 112
113 // Retrieve the screen rect for the launched window 113 // Retrieve the screen rect for the launched window
114 gfx::Rect bounds = browser()->window()->GetRestoredBounds(); 114 gfx::Rect bounds = browser()->window()->GetRestoredBounds();
(...skipping 21 matching lines...) Expand all
136 EXPECT_EQ(right, bounds.x() + bounds.width()); 136 EXPECT_EQ(right, bounds.x() + bounds.width());
137 137
138 // Find if launched window is maximized. 138 // Find if launched window is maximized.
139 bool is_window_maximized = browser()->window()->IsMaximized(); 139 bool is_window_maximized = browser()->window()->IsMaximized();
140 bool is_maximized = false; 140 bool is_maximized = false;
141 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized", 141 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized",
142 &is_maximized)); 142 &is_maximized));
143 EXPECT_EQ(is_maximized, is_window_maximized); 143 EXPECT_EQ(is_maximized, is_window_maximized);
144 } 144 }
145 #endif 145 #endif
OLDNEW
« no previous file with comments | « chrome/browser/prefs/leveldb_pref_store.cc ('k') | chrome/browser/prefs/tracked/pref_hash_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698