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

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

Issue 299753011: Move allocate instance id to chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HasPermission function moved Created 6 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/web_view/shim/main.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
index 78fb914f248ef3d3e979a90bd4c5b8e1c634623c..a911e2256d30233a932d9a0fcb6ef549332c7f81 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
@@ -583,13 +583,15 @@ function testCannotMutateEventName() {
// been set raises an exception.
function testPartitionRaisesException() {
var webview = document.createElement('webview');
- webview.setAttribute('partition', arguments.callee.name);
+ 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();
}
};
@@ -599,6 +601,27 @@ function testPartitionRaisesException() {
webview.setAttribute('src', 'data:text/html,trigger navigation');
}
+// This test verifies that removing partition attribute after navigation does
+// not work, i.e. the partition remains the same.
+function testPartitionRemovalAfterNavigationFails() {
+ var webview = document.createElement('webview');
+ document.body.appendChild(webview);
+
+ var partition = 'testme';
+ webview.setAttribute('partition', partition);
+
+ var loadstopHandler = function(e) {
+ window.console.log('webview.loadstop');
+ // Removing after navigation should not change the partition.
+ webview.removeAttribute('partition');
+ embedder.test.assertEq('testme', webview.partition);
+ embedder.test.succeed();
+ };
+ webview.addEventListener('loadstop', loadstopHandler);
+
+ webview.setAttribute('src', 'data:text/html,<html><body>guest</body></html>');
+}
+
function testExecuteScriptFail() {
var webview = document.createElement('webview');
document.body.appendChild(webview);
@@ -1691,6 +1714,8 @@ embedder.test.testList = {
'testDestroyOnEventListener': testDestroyOnEventListener,
'testCannotMutateEventName': testCannotMutateEventName,
'testPartitionRaisesException': testPartitionRaisesException,
+ 'testPartitionRemovalAfterNavigationFails':
+ testPartitionRemovalAfterNavigationFails,
'testExecuteScriptFail': testExecuteScriptFail,
'testExecuteScript': testExecuteScript,
'testExecuteScriptIsAbortedWhenWebViewSourceIsChanged':
« no previous file with comments | « chrome/renderer/resources/extensions/web_view.js ('k') | content/browser/browser_plugin/browser_plugin_embedder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698