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

Side by Side Diff: chrome/browser/pref_service_uitest.cc

Issue 1120006: detect preferences errors (Closed)
Patch Set: changes from review Created 10 years, 8 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
« no previous file with comments | « chrome/browser/pref_service.cc ('k') | chrome/browser/sync/glue/preference_change_processor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/test/test_file_util.h" 10 #include "base/test/test_file_util.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Also, not sure what should happen on the mac. In any case, the code below 79 // Also, not sure what should happen on the mac. In any case, the code below
80 // (minus the Windows bits) compiles fine on my Linux box now. 80 // (minus the Windows bits) compiles fine on my Linux box now.
81 // TODO(port): revisit this. 81 // TODO(port): revisit this.
82 TEST_F(PreferenceServiceTest, PreservedWindowPlacementIsLoaded) { 82 TEST_F(PreferenceServiceTest, PreservedWindowPlacementIsLoaded) {
83 // The window should open with the reference profile 83 // The window should open with the reference profile
84 ASSERT_TRUE(LaunchAppWithProfile()); 84 ASSERT_TRUE(LaunchAppWithProfile());
85 85
86 ASSERT_TRUE(file_util::PathExists(tmp_pref_file_)); 86 ASSERT_TRUE(file_util::PathExists(tmp_pref_file_));
87 87
88 JSONFileValueSerializer deserializer(tmp_pref_file_); 88 JSONFileValueSerializer deserializer(tmp_pref_file_);
89 scoped_ptr<Value> root(deserializer.Deserialize(NULL)); 89 scoped_ptr<Value> root(deserializer.Deserialize(NULL, NULL));
90 90
91 ASSERT_TRUE(root.get()); 91 ASSERT_TRUE(root.get());
92 ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); 92 ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY));
93 93
94 DictionaryValue* root_dict = static_cast<DictionaryValue*>(root.get()); 94 DictionaryValue* root_dict = static_cast<DictionaryValue*>(root.get());
95 95
96 // Retrieve the screen rect for the launched window 96 // Retrieve the screen rect for the launched window
97 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 97 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
98 ASSERT_TRUE(browser.get()); 98 ASSERT_TRUE(browser.get());
99 scoped_refptr<WindowProxy> window(browser->GetWindow()); 99 scoped_refptr<WindowProxy> window(browser->GetWindow());
(...skipping 26 matching lines...) Expand all
126 126
127 // Find if launched window is maximized. 127 // Find if launched window is maximized.
128 bool is_window_maximized = false; 128 bool is_window_maximized = false;
129 ASSERT_TRUE(window->IsMaximized(&is_window_maximized)); 129 ASSERT_TRUE(window->IsMaximized(&is_window_maximized));
130 bool is_maximized = false; 130 bool is_maximized = false;
131 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized", 131 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized",
132 &is_maximized)); 132 &is_maximized));
133 EXPECT_EQ(is_maximized, is_window_maximized); 133 EXPECT_EQ(is_maximized, is_window_maximized);
134 } 134 }
135 #endif 135 #endif
OLDNEW
« no previous file with comments | « chrome/browser/pref_service.cc ('k') | chrome/browser/sync/glue/preference_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698