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

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

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 years, 4 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
« no previous file with comments | « chrome/browser/prefs/pref_service.cc ('k') | chrome/browser/prefs/pref_value_store.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/scoped_temp_dir.h" 9 #include "base/scoped_temp_dir.h"
10 #include "base/test/test_file_util.h" 10 #include "base/test/test_file_util.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // placement values stored in the user data directory. 91 // placement values stored in the user data directory.
92 new_profile_ = true; 92 new_profile_ = true;
93 ASSERT_TRUE(LaunchAppWithProfile()); 93 ASSERT_TRUE(LaunchAppWithProfile());
94 94
95 ASSERT_TRUE(file_util::PathExists(tmp_pref_file_)); 95 ASSERT_TRUE(file_util::PathExists(tmp_pref_file_));
96 96
97 JSONFileValueSerializer deserializer(tmp_pref_file_); 97 JSONFileValueSerializer deserializer(tmp_pref_file_);
98 scoped_ptr<Value> root(deserializer.Deserialize(NULL, NULL)); 98 scoped_ptr<Value> root(deserializer.Deserialize(NULL, NULL));
99 99
100 ASSERT_TRUE(root.get()); 100 ASSERT_TRUE(root.get());
101 ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); 101 ASSERT_TRUE(root->IsDictionary());
102 102
103 DictionaryValue* root_dict = static_cast<DictionaryValue*>(root.get()); 103 DictionaryValue* root_dict = static_cast<DictionaryValue*>(root.get());
104 104
105 // Retrieve the screen rect for the launched window 105 // Retrieve the screen rect for the launched window
106 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 106 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
107 ASSERT_TRUE(browser.get()); 107 ASSERT_TRUE(browser.get());
108 scoped_refptr<WindowProxy> window(browser->GetWindow()); 108 scoped_refptr<WindowProxy> window(browser->GetWindow());
109 ASSERT_TRUE(window.get()); 109 ASSERT_TRUE(window.get());
110 110
111 gfx::Rect bounds; 111 gfx::Rect bounds;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // placement values stored in Local State. 149 // placement values stored in Local State.
150 new_profile_ = false; 150 new_profile_ = false;
151 ASSERT_TRUE(LaunchAppWithProfile()); 151 ASSERT_TRUE(LaunchAppWithProfile());
152 152
153 ASSERT_TRUE(file_util::PathExists(tmp_pref_file_)); 153 ASSERT_TRUE(file_util::PathExists(tmp_pref_file_));
154 154
155 JSONFileValueSerializer deserializer(tmp_pref_file_); 155 JSONFileValueSerializer deserializer(tmp_pref_file_);
156 scoped_ptr<Value> root(deserializer.Deserialize(NULL, NULL)); 156 scoped_ptr<Value> root(deserializer.Deserialize(NULL, NULL));
157 157
158 ASSERT_TRUE(root.get()); 158 ASSERT_TRUE(root.get());
159 ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); 159 ASSERT_TRUE(root->IsDictionary());
160 160
161 // Retrieve the screen rect for the launched window 161 // Retrieve the screen rect for the launched window
162 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 162 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
163 ASSERT_TRUE(browser.get()); 163 ASSERT_TRUE(browser.get());
164 scoped_refptr<WindowProxy> window(browser->GetWindow()); 164 scoped_refptr<WindowProxy> window(browser->GetWindow());
165 ASSERT_TRUE(window.get()); 165 ASSERT_TRUE(window.get());
166 166
167 gfx::Rect bounds; 167 gfx::Rect bounds;
168 ASSERT_TRUE(window->GetBounds(&bounds)); 168 ASSERT_TRUE(window->GetBounds(&bounds));
169 169
(...skipping 28 matching lines...) Expand all
198 // Find if launched window is maximized. 198 // Find if launched window is maximized.
199 bool is_window_maximized = false; 199 bool is_window_maximized = false;
200 ASSERT_TRUE(window->IsMaximized(&is_window_maximized)); 200 ASSERT_TRUE(window->IsMaximized(&is_window_maximized));
201 bool is_maximized = false; 201 bool is_maximized = false;
202 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized", 202 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized",
203 &is_maximized)); 203 &is_maximized));
204 EXPECT_EQ(is_maximized, is_window_maximized); 204 EXPECT_EQ(is_maximized, is_window_maximized);
205 } 205 }
206 #endif 206 #endif
207 207
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_service.cc ('k') | chrome/browser/prefs/pref_value_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698