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

Unified Diff: chrome/browser/extensions/api/app_window/app_window_apitest.cc

Issue 11369039: Add setBounds method and browsertest for get/set bounds to app window API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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
« no previous file with comments | « chrome/browser/extensions/api/app_window/app_window_api.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/app_window/app_window_apitest.cc
diff --git a/chrome/browser/extensions/api/app_window/app_window_apitest.cc b/chrome/browser/extensions/api/app_window/app_window_apitest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..09d42b4469479d032912578b30cfba8fdd469618
--- /dev/null
+++ b/chrome/browser/extensions/api/app_window/app_window_apitest.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/string_number_conversions.h"
+#include "chrome/browser/extensions/extension_test_message_listener.h"
+#include "chrome/browser/extensions/platform_app_browsertest_util.h"
+#include "chrome/browser/ui/base_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
+#include "ui/gfx/rect.h"
+
+namespace extensions {
+
+IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiBounds) {
+ ExtensionTestMessageListener background_listener("background_ok", false);
+ ExtensionTestMessageListener ready_listener("ready", true /* will_reply */);
+ ExtensionTestMessageListener success_listener("success", false);
+
+ LoadAndLaunchPlatformApp("windows_api_bounds");
+ ASSERT_TRUE(background_listener.WaitUntilSatisfied());
+ ASSERT_TRUE(ready_listener.WaitUntilSatisfied());
+ ShellWindow* window = GetFirstShellWindow();
+
+ gfx::Rect new_bounds(100, 200, 300, 400);
+ window->GetBaseWindow()->SetBounds(new_bounds);
+
+ // TODO(jeremya/asargent) figure out why in GTK the window doesn't end up
+ // with exactly the bounds we set. Is it a bug in our shell window
+ // implementation? crbug.com/160252
+#ifdef TOOLKIT_GTK
+ int slop = 50;
+#else
+ int slop = 0;
+#endif // !TOOLKIT_GTK
+
+ ready_listener.Reply(base::IntToString(slop));
+ ASSERT_TRUE(success_listener.WaitUntilSatisfied());
+}
+
+} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/api/app_window/app_window_api.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698