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

Unified Diff: extensions/test/data/web_view/apitest/main.js

Issue 698973003: Got rid of the internal copies of webview attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small fix. Created 6 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 | « extensions/renderer/resources/guest_view/web_view_attributes.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/data/web_view/apitest/main.js
diff --git a/extensions/test/data/web_view/apitest/main.js b/extensions/test/data/web_view/apitest/main.js
index 1287723c26f0e1a008f9ad2ffe116983b063f07c..2c8d15f60313f8508e117e7d3677bcbce014aafb 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,
« no previous file with comments | « extensions/renderer/resources/guest_view/web_view_attributes.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698