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

Unified Diff: chrome/test/data/extensions/platform_apps/windows_api_bounds/background.js

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
Index: chrome/test/data/extensions/platform_apps/windows_api_bounds/background.js
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_bounds/background.js b/chrome/test/data/extensions/platform_apps/windows_api_bounds/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..2bac58b9749ce60edda8dd3189e99735592c37c1
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_bounds/background.js
@@ -0,0 +1,20 @@
+// 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.
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.app.window.create("main.html", function(win){
+ // Make sure we get back a bounds and that it isn't all 0's.
+ var bounds = win.getBounds();
+ if (!bounds ||
+ (bounds.top == 0 && bounds.left == 0 &&
+ bounds.width == 0 && bounds.height == 0)) {
+ console.error("invalid bounds after app.window.create:" +
+ JSON.stringify(bounds));
+ win.close();
+ window.close();
+ } else {
+ chrome.test.sendMessage("background_ok");
+ }
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698