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

Unified Diff: chrome/test/data/extensions/platform_apps/browser_tag/main.js

Issue 10598006: Browser tag shim (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: HasExtensionPermission Created 8 years, 6 months 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/browser_tag/main.js
diff --git a/chrome/test/data/extensions/platform_apps/browser_tag/main.js b/chrome/test/data/extensions/platform_apps/browser_tag/main.js
new file mode 100644
index 0000000000000000000000000000000000000000..98a864291d57912d228e612fe33e6c727b81320b
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/browser_tag/main.js
@@ -0,0 +1,41 @@
+// 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.
+
+onload = function() {
+ chrome.test.runTests([
+ function browserTag() {
+ var browserTag = document.querySelector('browser');
+ // Since we can't currently inspect the page loaded inside the <browser>,
+ // the only way we can check that the shim is working is by changing the
+ // size and seeing if the shim updates the size of the DOM.
+ chrome.test.assertEq(300, browserTag.offsetWidth);
+ chrome.test.assertEq(200, browserTag.offsetHeight);
+
+ browserTag.setAttribute('width', 310);
+ browserTag.setAttribute('height', 210);
+
+ // Timeout is necessary to give the mutation observers a chance to fire.
+ setTimeout(function() {
+ chrome.test.assertEq(310, browserTag.offsetWidth);
+ chrome.test.assertEq(210, browserTag.offsetHeight);
+
+ // Should also be able to query/update the dimensions via getterts/
+ // setters.
+ chrome.test.assertEq(310, browserTag.width);
+ chrome.test.assertEq(210, browserTag.height);
+
+ browserTag.width = 320;
+ browserTag.height = 220;
+
+ // Setters also end up operating via mutation observers.
+ setTimeout(function() {
+ chrome.test.assertEq(320, browserTag.offsetWidth);
+ chrome.test.assertEq(220, browserTag.offsetHeight);
+
+ chrome.test.succeed();
+ }, 0);
+ }, 0);
+ }
+ ]);
+};

Powered by Google App Engine
This is Rietveld 408576698