Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 3195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3206 content::TestNavigationObserver observer(app_contents, 1); | 3206 content::TestNavigationObserver observer(app_contents, 1); |
| 3207 ui_test_utils::NavigateToURL(app_browser, GURL(url::kAboutBlankURL)); | 3207 ui_test_utils::NavigateToURL(app_browser, GURL(url::kAboutBlankURL)); |
| 3208 observer.Wait(); | 3208 observer.Wait(); |
| 3209 | 3209 |
| 3210 CheckDisplayModeMQ(ASCIIToUTF16("fullscreen"), app_contents); | 3210 CheckDisplayModeMQ(ASCIIToUTF16("fullscreen"), app_contents); |
| 3211 } | 3211 } |
| 3212 | 3212 |
| 3213 // Test to ensure the bounds of popup, devtool, and app windows are properly | 3213 // Test to ensure the bounds of popup, devtool, and app windows are properly |
| 3214 // restored. | 3214 // restored. |
| 3215 IN_PROC_BROWSER_TEST_F(BrowserTest, TestPopupBounds) { | 3215 IN_PROC_BROWSER_TEST_F(BrowserTest, TestPopupBounds) { |
| 3216 // TODO(tdanderson|pkasting): Change the first test to verify that the | |
|
Peter Kasting
2016/02/10 23:46:21
Nit: "the first test" -> "this", since there are a
tdanderson
2016/02/11 16:10:21
Done.
| |
| 3217 // contents bounds set by params.initial_bounds | |
|
Peter Kasting
2016/02/10 23:46:21
Nit: Don't indent the text on these lines
tdanderson
2016/02/11 16:10:21
Done.
| |
| 3218 // are the same as the contents bounds in the | |
| 3219 // initialized window. See crbug.com/585856. | |
| 3216 { | 3220 { |
| 3217 // Minimum size that a popup window should have appended to its height when | 3221 // Minimum size that a popup window should have appended to its height when |
| 3218 // drawn (popup window bounds are for the content, not the window). This is | 3222 // drawn (popup window bounds are for the content, not the window). This is |
| 3219 // the size of the toolbar on views platforms. | 3223 // the size of the toolbar on views platforms. |
| 3224 #if defined(OS_CHROMEOS) | |
|
Peter Kasting
2016/02/10 23:46:21
Nit: I would eliminate the ifdef here, use the CrO
tdanderson
2016/02/11 16:10:21
Done.
| |
| 3225 const int minimum_popup_padding = 27; | |
| 3226 #else | |
| 3220 const int minimum_popup_padding = 29; | 3227 const int minimum_popup_padding = 29; |
| 3228 #endif // defined(OS_CHROMEOS) | |
| 3221 | 3229 |
| 3222 // Creates an untrusted popup window and asserts that the eventual height is | 3230 // Creates an untrusted popup window and asserts that the eventual height is |
| 3223 // padded with the toolbar and title bar height (initial height is content | 3231 // padded with the toolbar and title bar height (initial height is content |
| 3224 // height). | 3232 // height). |
| 3225 Browser::CreateParams params(Browser::TYPE_POPUP, browser()->profile()); | 3233 Browser::CreateParams params(Browser::TYPE_POPUP, browser()->profile()); |
| 3226 params.initial_bounds = gfx::Rect(0, 0, 100, 122); | 3234 params.initial_bounds = gfx::Rect(0, 0, 100, 122); |
| 3227 Browser* browser = new Browser(params); | 3235 Browser* browser = new Browser(params); |
| 3228 gfx::Rect bounds = browser->window()->GetBounds(); | 3236 gfx::Rect bounds = browser->window()->GetBounds(); |
| 3229 | 3237 |
| 3230 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 3238 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3291 Browser* browser = new Browser(params); | 3299 Browser* browser = new Browser(params); |
| 3292 gfx::Rect bounds = browser->window()->GetBounds(); | 3300 gfx::Rect bounds = browser->window()->GetBounds(); |
| 3293 | 3301 |
| 3294 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 3302 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
| 3295 // See https://crbug.com/567925. | 3303 // See https://crbug.com/567925. |
| 3296 EXPECT_GE(bounds.width(), 100); | 3304 EXPECT_GE(bounds.width(), 100); |
| 3297 EXPECT_EQ(122, bounds.height()); | 3305 EXPECT_EQ(122, bounds.height()); |
| 3298 browser->window()->Close(); | 3306 browser->window()->Close(); |
| 3299 } | 3307 } |
| 3300 } | 3308 } |
| OLD | NEW |