Chromium Code Reviews| Index: visual_studio/NativeClientVSAddIn/TestingProjects/DummyLoop/DummyLoop/index.html |
| diff --git a/visual_studio/NativeClientVSAddIn/TestingProjects/DummyLoop/DummyLoop/index.html b/visual_studio/NativeClientVSAddIn/TestingProjects/DummyLoop/DummyLoop/index.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b78ab81930b89f2e7094d845544a97521cda9044 |
| --- /dev/null |
| +++ b/visual_studio/NativeClientVSAddIn/TestingProjects/DummyLoop/DummyLoop/index.html |
| @@ -0,0 +1,53 @@ |
| +<!DOCTYPE html> |
| +<html> |
| + <!-- |
| + 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. |
| + --> |
| +<head> |
| + <meta http-equiv="Pragma" content="no-cache" /> |
|
binji
2012/07/20 00:24:53
<meta> tag does not need to be closed
tysand
2012/08/07 23:01:54
Done.
|
| + <meta http-equiv="Expires" content="-1" /> |
| + <script type="text/javascript"> |
| + function pageDidLoad() { |
| + updateStatus('Page loaded.'); |
| + } |
| + |
| + // Set the global status message |
| + function updateStatus(opt_message) { |
| + naclModule = document.getElementById('dummy_loop'); |
| + var statusField = document.getElementById('status_field'); |
| + if (statusField) { |
| + statusField.innerHTML = opt_message; |
| + } |
| + if (opt_message == "relay1") { |
|
binji
2012/07/20 00:24:53
nit: seems like the message ping-ponging makes mor
tysand
2012/08/07 23:01:54
Done.
|
| + naclModule.postMessage("relay2"); |
| + } |
| + if (opt_message == "relay2") { |
| + naclModule.postMessage("relay1"); |
| + } |
| + } |
| + |
| + function handleMessage(message_event) { |
| + updateStatus(message_event.data); |
| + } |
| + |
| + </script> |
| +</head> |
| +<body onload="pageDidLoad()"> |
| + <div id="listener"> |
|
binji
2012/07/20 00:24:53
nit: match the NaCl SDK example layout:
<h1>title<
tysand
2012/08/07 23:01:54
Done. I rearranged to match layout but excluded ti
|
| + <script type="text/javascript"> |
| + var listener = document.getElementById('listener'); |
| + listener.addEventListener('message', handleMessage, true); |
| + </script> |
| + <embed name='nacl_module' |
|
binji
2012/07/20 00:24:53
nit: use double-quotes for element attributes
tysand
2012/08/07 23:01:54
Done.
|
| + id='dummy_loop' |
|
binji
2012/07/20 00:24:53
nit: use nacl_module for id.
tysand
2012/08/07 23:01:54
Done.
|
| + width=200 |
| + height=200 |
| + src='dummy_loop.nmf' |
| + type='application/x-nacl'/> |
| + </div> |
| +<h2>Status</h2> |
| +<div id="status_field">NO-STATUS</div> |
| +</body> |
| +</html> |