OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/values.h" | 9 #include "base/values.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 JSONFileValueSerializer deserializer(tmp_pref_file_); | 85 JSONFileValueSerializer deserializer(tmp_pref_file_); |
86 scoped_ptr<Value> root(deserializer.Deserialize(NULL)); | 86 scoped_ptr<Value> root(deserializer.Deserialize(NULL)); |
87 | 87 |
88 ASSERT_TRUE(root.get()); | 88 ASSERT_TRUE(root.get()); |
89 ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); | 89 ASSERT_TRUE(root->IsType(Value::TYPE_DICTIONARY)); |
90 | 90 |
91 DictionaryValue* root_dict = static_cast<DictionaryValue*>(root.get()); | 91 DictionaryValue* root_dict = static_cast<DictionaryValue*>(root.get()); |
92 | 92 |
93 // Retrieve the screen rect for the launched window | 93 // Retrieve the screen rect for the launched window |
94 scoped_ptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 94 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
95 ASSERT_TRUE(browser.get()); | 95 ASSERT_TRUE(browser.get()); |
96 scoped_ptr<WindowProxy> window(browser->GetWindow()); | 96 scoped_refptr<WindowProxy> window(browser->GetWindow()); |
97 | 97 |
98 HWND hWnd; | 98 HWND hWnd; |
99 ASSERT_TRUE(window->GetHWND(&hWnd)); | 99 ASSERT_TRUE(window->GetHWND(&hWnd)); |
100 | 100 |
101 WINDOWPLACEMENT window_placement; | 101 WINDOWPLACEMENT window_placement; |
102 ASSERT_TRUE(GetWindowPlacement(hWnd, &window_placement)); | 102 ASSERT_TRUE(GetWindowPlacement(hWnd, &window_placement)); |
103 | 103 |
104 // Retrieve the expected rect values from "Preferences" | 104 // Retrieve the expected rect values from "Preferences" |
105 int bottom = 0; | 105 int bottom = 0; |
106 std::wstring kBrowserWindowPlacement(prefs::kBrowserWindowPlacement); | 106 std::wstring kBrowserWindowPlacement(prefs::kBrowserWindowPlacement); |
(...skipping 18 matching lines...) Expand all Loading... |
125 | 125 |
126 // Find if launched window is maximized | 126 // Find if launched window is maximized |
127 bool is_window_maximized = (window_placement.showCmd == SW_MAXIMIZE); | 127 bool is_window_maximized = (window_placement.showCmd == SW_MAXIMIZE); |
128 | 128 |
129 bool is_maximized = false; | 129 bool is_maximized = false; |
130 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized", | 130 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized", |
131 &is_maximized)); | 131 &is_maximized)); |
132 EXPECT_EQ(is_maximized, is_window_maximized); | 132 EXPECT_EQ(is_maximized, is_window_maximized); |
133 } | 133 } |
134 #endif | 134 #endif |
OLD | NEW |