Chromium Code Reviews| 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 ready_listener("ready", true /* will_reply */); | |
| 16 ExtensionTestMessageListener success_listener("success", false); | |
| 17 | |
| 18 LoadAndLaunchPlatformApp("windows_api_bounds"); | |
| 19 ASSERT_TRUE(ready_listener.WaitUntilSatisfied()); | |
| 20 ShellWindow* window = GetFirstShellWindow(); | |
| 21 | |
| 22 gfx::Rect new_bounds(100, 200, 300, 400); | |
| 23 window->GetBaseWindow()->SetBounds(new_bounds); | |
| 24 | |
| 25 // Some windowing environments don't precisely match the requested | |
| 26 // window bounds we set, so define a slop factor for the client to use in | |
| 27 // judging success. | |
| 28 #ifdef TOOLKIT_GTK | |
| 29 int slop = 50; | |
| 30 #else | |
| 31 int slop = 10; | |
|
jeremya
2012/11/02 05:06:41
What other platforms are these functions inaccurat
asargent_no_longer_on_chrome
2012/11/09 20:25:35
Done.
| |
| 32 #endif // !TOOLKIT_GTK | |
| 33 | |
| 34 ready_listener.Reply(base::IntToString(slop)); | |
| 35 ASSERT_TRUE(success_listener.WaitUntilSatisfied()); | |
| 36 } | |
| 37 | |
| 38 } // namespace extensions | |
| OLD | NEW |