OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |