| Index: chrome/test/data/extensions/platform_apps/web_view/common/cleardata_twice/guest.html
|
| diff --git a/chrome/test/data/extensions/platform_apps/web_view/common/cleardata_twice/guest.html b/chrome/test/data/extensions/platform_apps/web_view/common/cleardata_twice/guest.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..30d2c3278622f1cdab1b49a06361db502d55fa80
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/platform_apps/web_view/common/cleardata_twice/guest.html
|
| @@ -0,0 +1,41 @@
|
| +<!doctype html>
|
| +<!--
|
| + * Copyright 2016 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.
|
| +-->
|
| +<html>
|
| + <head>
|
| + <script type="text/javascript">
|
| + // A guest that stores and deletes cookies.
|
| + // Note that the embedder has to initiate a postMessage first so that
|
| + // the guest has a reference to the embedder's window.
|
| +
|
| + // The window reference of the embedder to send post message reply.
|
| + var embedderWindowChannel = null;
|
| +
|
| + // A value that uniquely identifies the guest sending the messages to the
|
| + // embedder.
|
| + var channelId = 0;
|
| + var notifyEmbedder = function(msg_array) {
|
| + var msg = msg_array.concat([channelId]);
|
| + embedderWindowChannel.postMessage(JSON.stringify(msg), '*');
|
| + };
|
| +
|
| + var onPostMessageReceived = function(e) {
|
| + embedderWindowChannel = e.source;
|
| + var data = JSON.parse(e.data);
|
| + if (data[0] == 'create-channel') {
|
| + window.console.log('guest: create-channel');
|
| + channelId = data[1];
|
| + notifyEmbedder(['channel-created']);
|
| + return;
|
| + }
|
| + };
|
| + window.addEventListener('message', onPostMessageReceived, false);
|
| + </script>
|
| + </head>
|
| + <body>
|
| + <div>Simple guest page.</div>
|
| + </body>
|
| +</html>
|
|
|