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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // might be able to make this work on buildbots. 83 // might be able to make this work on buildbots.
84 // TODO(port): revisit this. 84 // TODO(port): revisit this.
85 85
86 IN_PROC_BROWSER_TEST_F(PreferenceServiceTest, Test) { 86 IN_PROC_BROWSER_TEST_F(PreferenceServiceTest, Test) {
87 // The window should open with the new reference profile, with window 87 // The window should open with the new reference profile, with window
88 // placement values stored in the user data directory. 88 // placement values stored in the user data directory.
89 JSONFileValueDeserializer deserializer(original_pref_file_); 89 JSONFileValueDeserializer deserializer(original_pref_file_);
90 std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, NULL); 90 std::unique_ptr<base::Value> root = deserializer.Deserialize(NULL, NULL);
91 91
92 ASSERT_TRUE(root.get()); 92 ASSERT_TRUE(root.get());
93 ASSERT_TRUE(root->IsType(base::Value::TYPE_DICTIONARY)); 93 ASSERT_TRUE(root->IsType(base::Value::Type::DICTIONARY));
94 94
95 base::DictionaryValue* root_dict = 95 base::DictionaryValue* root_dict =
96 static_cast<base::DictionaryValue*>(root.get()); 96 static_cast<base::DictionaryValue*>(root.get());
97 97
98 // Retrieve the screen rect for the launched window 98 // Retrieve the screen rect for the launched window
99 gfx::Rect bounds = browser()->window()->GetRestoredBounds(); 99 gfx::Rect bounds = browser()->window()->GetRestoredBounds();
100 100
101 // Retrieve the expected rect values from "Preferences" 101 // Retrieve the expected rect values from "Preferences"
102 int bottom = 0; 102 int bottom = 0;
103 std::string kBrowserWindowPlacement(prefs::kBrowserWindowPlacement); 103 std::string kBrowserWindowPlacement(prefs::kBrowserWindowPlacement);
(...skipping 17 matching lines...) Expand all
121 EXPECT_EQ(right, bounds.x() + bounds.width()); 121 EXPECT_EQ(right, bounds.x() + bounds.width());
122 122
123 // Find if launched window is maximized. 123 // Find if launched window is maximized.
124 bool is_window_maximized = browser()->window()->IsMaximized(); 124 bool is_window_maximized = browser()->window()->IsMaximized();
125 bool is_maximized = false; 125 bool is_maximized = false;
126 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized", 126 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized",
127 &is_maximized)); 127 &is_maximized));
128 EXPECT_EQ(is_maximized, is_window_maximized); 128 EXPECT_EQ(is_maximized, is_window_maximized);
129 } 129 }
130 #endif 130 #endif
OLDNEW
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_unittest.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