summaryrefslogtreecommitdiffstats
path: root/extensions/test
diff options
context:
space:
mode:
authorpaulmeyer <paulmeyer@chromium.org>2014-11-04 13:01:39 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-04 21:02:00 +0000
commitabb035a09b79c2e0b6d9fb87b47e823e2f8e0549 (patch)
tree25369c594463c4cf054693c64accd80d9b7679bc /extensions/test
parent71ffa2147e36e87212d2a1e0c56d47cdc77a8410 (diff)
downloadchromium_src-abb035a09b79c2e0b6d9fb87b47e823e2f8e0549.zip
chromium_src-abb035a09b79c2e0b6d9fb87b47e823e2f8e0549.tar.gz
chromium_src-abb035a09b79c2e0b6d9fb87b47e823e2f8e0549.tar.bz2
Got rid of the internal copies of webview attributes.
Webview attributes are now only stored in one location (in the webview node), so that all the code needed to sync up the copies could be removed (and was). Also reworked the behavior of the |allowtransparency| and |autosize| to be both consistent with each other and more intuitive in general (they are both treated like booleans now). I updated the tests to reflect this new behavior. Review URL: https://codereview.chromium.org/698973003 Cr-Commit-Position: refs/heads/master@{#302661}
Diffstat (limited to 'extensions/test')
-rw-r--r--extensions/test/data/web_view/apitest/main.js31
1 files changed, 17 insertions, 14 deletions
diff --git a/extensions/test/data/web_view/apitest/main.js b/extensions/test/data/web_view/apitest/main.js
index 1287723..2c8d15f 100644
--- a/extensions/test/data/web_view/apitest/main.js
+++ b/extensions/test/data/web_view/apitest/main.js
@@ -71,15 +71,22 @@ embedder.test.succeed = function() {
function testAllowTransparencyAttribute() {
var webview = document.createElement('webview');
webview.src = 'data:text/html,webview test';
+ embedder.test.assertFalse(webview.hasAttribute('allowtransparency'));
+ embedder.test.assertFalse(webview.allowtransparency);
webview.allowtransparency = true;
webview.addEventListener('loadstop', function(e) {
embedder.test.assertTrue(webview.hasAttribute('allowtransparency'));
- webview.allowtransparency = false;
embedder.test.assertTrue(webview.allowtransparency);
- embedder.test.assertTrue(webview.hasAttribute('allowtransparency'));
- webview.removeAttribute('allowtransparency');
+ webview.allowtransparency = false;
+ embedder.test.assertFalse(webview.hasAttribute('allowtransparency'));
embedder.test.assertFalse(webview.allowtransparency);
+ webview.allowtransparency = '';
+ embedder.test.assertFalse(webview.hasAttribute('allowtransparency'));
+ embedder.test.assertFalse(webview.allowtransparency);
+ webview.allowtransparency = 'some string';
+ embedder.test.assertTrue(webview.hasAttribute('allowtransparency'));
+ embedder.test.assertTrue(webview.allowtransparency);
embedder.test.succeed();
});
@@ -1282,21 +1289,17 @@ function testOnEventProperties() {
document.body.appendChild(webview);
}
-// This test verifies that setting the partition attribute after the src has
-// been set raises an exception.
-function testPartitionRaisesException() {
+// This test verifies that the partion attribute cannot be changed after the src
+// has been set.
+function testPartitionChangeAfterNavigation() {
var webview = document.createElement('webview');
var partitionAttribute = arguments.callee.name;
webview.setAttribute('partition', partitionAttribute);
var loadstopHandler = function(e) {
- try {
- webview.partition = 'illegal';
- embedder.test.fail();
- } catch (e) {
- embedder.test.assertEq(partitionAttribute, webview.partition);
- embedder.test.succeed();
- }
+ webview.partition = 'illegal';
+ embedder.test.assertEq(partitionAttribute, webview.partition);
+ embedder.test.succeed();
};
webview.addEventListener('loadstop', loadstopHandler);
@@ -1707,7 +1710,7 @@ embedder.test.testList = {
'testNewWindowNoReferrerLink': testNewWindowNoReferrerLink,
'testNewWindowTwoListeners': testNewWindowTwoListeners,
'testOnEventProperties': testOnEventProperties,
- 'testPartitionRaisesException': testPartitionRaisesException,
+ 'testPartitionChangeAfterNavigation': testPartitionChangeAfterNavigation,
'testPartitionRemovalAfterNavigationFails':
testPartitionRemovalAfterNavigationFails,
'testReassignSrcAttribute': testReassignSrcAttribute,