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

Unified Diff: chrome/common/pref_service_uitest.cc

Issue 211033: Automated ui test porting + cleanup:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: all green\! Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/pref_service_uitest.cc
===================================================================
--- chrome/common/pref_service_uitest.cc (revision 26702)
+++ chrome/common/pref_service_uitest.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/gfx/rect.h"
#include "base/test_file_util.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -96,37 +97,34 @@
ASSERT_TRUE(browser.get());
scoped_refptr<WindowProxy> window(browser->GetWindow());
- HWND hWnd;
- ASSERT_TRUE(window->GetHWND(&hWnd));
+ gfx::Rect bounds;
+ ASSERT_TRUE(window->GetBounds(&bounds));
- WINDOWPLACEMENT window_placement;
- ASSERT_TRUE(GetWindowPlacement(hWnd, &window_placement));
-
// Retrieve the expected rect values from "Preferences"
int bottom = 0;
std::wstring kBrowserWindowPlacement(prefs::kBrowserWindowPlacement);
EXPECT_TRUE(root_dict->GetInteger(kBrowserWindowPlacement + L".bottom",
&bottom));
- EXPECT_EQ(bottom, window_placement.rcNormalPosition.bottom);
+ EXPECT_EQ(bottom, bounds.y() + bounds.height());
int top = 0;
EXPECT_TRUE(root_dict->GetInteger(kBrowserWindowPlacement + L".top",
&top));
- EXPECT_EQ(top, window_placement.rcNormalPosition.top);
+ EXPECT_EQ(top, bounds.y());
int left = 0;
EXPECT_TRUE(root_dict->GetInteger(kBrowserWindowPlacement + L".left",
&left));
- EXPECT_EQ(left, window_placement.rcNormalPosition.left);
+ EXPECT_EQ(left, bounds.x());
int right = 0;
EXPECT_TRUE(root_dict->GetInteger(kBrowserWindowPlacement + L".right",
&right));
- EXPECT_EQ(right, window_placement.rcNormalPosition.right);
+ EXPECT_EQ(right, bounds.x() + bounds.width());
- // Find if launched window is maximized
- bool is_window_maximized = (window_placement.showCmd == SW_MAXIMIZE);
-
+ // Find if launched window is maximized.
+ bool is_window_maximized = false;
+ ASSERT_TRUE(window->IsMaximized(&is_window_maximized));
bool is_maximized = false;
EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + L".maximized",
&is_maximized));

Powered by Google App Engine
This is Rietveld 408576698