| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/string_number_conversions.h" |
| 6 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 7 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
| 8 #include "chrome/browser/ui/base_window.h" |
| 9 #include "chrome/browser/ui/extensions/shell_window.h" |
| 10 #include "ui/gfx/rect.h" |
| 11 |
| 12 namespace extensions { |
| 13 |
| 14 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiBounds) { |
| 15 ExtensionTestMessageListener background_listener("background_ok", false); |
| 16 ExtensionTestMessageListener ready_listener("ready", true /* will_reply */); |
| 17 ExtensionTestMessageListener success_listener("success", false); |
| 18 |
| 19 LoadAndLaunchPlatformApp("windows_api_bounds"); |
| 20 ASSERT_TRUE(background_listener.WaitUntilSatisfied()); |
| 21 ASSERT_TRUE(ready_listener.WaitUntilSatisfied()); |
| 22 ShellWindow* window = GetFirstShellWindow(); |
| 23 |
| 24 gfx::Rect new_bounds(100, 200, 300, 400); |
| 25 window->GetBaseWindow()->SetBounds(new_bounds); |
| 26 |
| 27 // TODO(jeremya/asargent) figure out why in GTK the window doesn't end up |
| 28 // with exactly the bounds we set. Is it a bug in our shell window |
| 29 // implementation? crbug.com/160252 |
| 30 #ifdef TOOLKIT_GTK |
| 31 int slop = 50; |
| 32 #else |
| 33 int slop = 0; |
| 34 #endif // !TOOLKIT_GTK |
| 35 |
| 36 ready_listener.Reply(base::IntToString(slop)); |
| 37 ASSERT_TRUE(success_listener.WaitUntilSatisfied()); |
| 38 } |
| 39 |
| 40 } // namespace extensions |
| OLD | NEW |