| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #if !defined(TOOLKIT_GTK) | 29 #if !defined(TOOLKIT_GTK) |
| 30 | 30 |
| 31 typedef InProcessBrowserTest PreservedWindowPlacement; | 31 typedef InProcessBrowserTest PreservedWindowPlacement; |
| 32 | 32 |
| 33 IN_PROC_BROWSER_TEST_F(PreservedWindowPlacement, PRE_Test) { | 33 IN_PROC_BROWSER_TEST_F(PreservedWindowPlacement, PRE_Test) { |
| 34 browser()->window()->SetBounds(gfx::Rect(20, 30, 400, 500)); | 34 browser()->window()->SetBounds(gfx::Rect(20, 30, 400, 500)); |
| 35 } | 35 } |
| 36 | 36 |
| 37 IN_PROC_BROWSER_TEST_F(PreservedWindowPlacement, Test) { | 37 IN_PROC_BROWSER_TEST_F(PreservedWindowPlacement, Test) { |
| 38 gfx::Rect bounds = browser()->window()->GetBounds(); | 38 gfx::Rect bounds = browser()->window()->GetBounds(); |
| 39 |
| 39 gfx::Rect expected_bounds(gfx::Rect(20, 30, 400, 500)); | 40 gfx::Rect expected_bounds(gfx::Rect(20, 30, 400, 500)); |
| 40 ASSERT_EQ(expected_bounds.ToString(), bounds.ToString()); | 41 ASSERT_EQ(expected_bounds, bounds); |
| 41 } | 42 } |
| 42 | 43 |
| 43 #endif // defined(TOOLKIT_GTK) | 44 #endif // defined(TOOLKIT_GTK) |
| 44 | 45 |
| 45 class PreferenceServiceTest : public InProcessBrowserTest { | 46 class PreferenceServiceTest : public InProcessBrowserTest { |
| 46 public: | 47 public: |
| 47 explicit PreferenceServiceTest(bool new_profile) : new_profile_(new_profile) { | 48 explicit PreferenceServiceTest(bool new_profile) : new_profile_(new_profile) { |
| 48 } | 49 } |
| 49 | 50 |
| 50 virtual bool SetUpUserDataDirectory() OVERRIDE { | 51 virtual bool SetUpUserDataDirectory() OVERRIDE { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 EXPECT_EQ(right, bounds.x() + bounds.width()); | 200 EXPECT_EQ(right, bounds.x() + bounds.width()); |
| 200 | 201 |
| 201 // Find if launched window is maximized. | 202 // Find if launched window is maximized. |
| 202 bool is_window_maximized = browser()->window()->IsMaximized(); | 203 bool is_window_maximized = browser()->window()->IsMaximized(); |
| 203 bool is_maximized = false; | 204 bool is_maximized = false; |
| 204 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized", | 205 EXPECT_TRUE(root_dict->GetBoolean(kBrowserWindowPlacement + ".maximized", |
| 205 &is_maximized)); | 206 &is_maximized)); |
| 206 EXPECT_EQ(is_maximized, is_window_maximized); | 207 EXPECT_EQ(is_maximized, is_window_maximized); |
| 207 } | 208 } |
| 208 #endif | 209 #endif |
| OLD | NEW |