| Index: ppapi/native_client/tests/nacl_browser/manifest_file/pm_pre_init_manifest_file_test.html
|
| diff --git a/ppapi/native_client/tests/nacl_browser/manifest_file/pm_pre_init_manifest_file_test.html b/ppapi/native_client/tests/nacl_browser/manifest_file/pm_pre_init_manifest_file_test.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5b54140820a206f4e0a066c344864b2daeddb7dc
|
| --- /dev/null
|
| +++ b/ppapi/native_client/tests/nacl_browser/manifest_file/pm_pre_init_manifest_file_test.html
|
| @@ -0,0 +1,64 @@
|
| +<!--
|
| + Copyright 2011 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.
|
| +-->
|
| +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
| + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| +<html>
|
| + <head>
|
| + <meta http-equiv="Pragma" content="no-cache" />
|
| + <meta http-equiv="Expires" content="-1" />
|
| + <script type="text/javascript" src="nacltest.js"></script>
|
| + <title>Native Client Pre-Init Post Message Manifest File Test</title>
|
| + </head>
|
| +
|
| + <body>
|
| + <h1>Native Client Pre-Init Post Message Manifest File Test</h1>
|
| + <div>
|
| + <embed id="naclModule"
|
| + name="naclModule"
|
| + width=400 height=400
|
| + src="pm_pre_init_manifest_file.nmf"
|
| + basic_tests="2"
|
| + stress_tests="0"
|
| + style="background-color:gray"
|
| + type="application/x-nacl" />
|
| + </div>
|
| +
|
| + <script type="text/javascript">
|
| + //<![CDATA[
|
| +function setupTests(tester, plugin) {
|
| + tester.addAsyncTest('Test_00_ManifestData', function(status) {
|
| + plugin.addEventListener('message', function(message_event) {
|
| + this.removeEventListener('message', arguments.callee, false);
|
| + var golden = 'File Contents:\nTest File Content\nOpening non-existent file:\nGot descriptor -1, status 0\n';
|
| + status.log('expecting golden: ' + golden);
|
| + status.log('golden.length: ' + golden.length);
|
| + status.log('message_event.data.length: ' + message_event.data.length);
|
| + var min_length = Math.min(message_event.data.length, golden.length);
|
| + status.log('min_length = ' + min_length);
|
| + var i = 0;
|
| + for (i = 0; i < min_length; i++) {
|
| + var mchar = message_event.data.charAt(i);
|
| + var gchar = golden.charAt(i);
|
| + if (mchar != gchar) {
|
| + status.log('char at ' + i + ' differ: ' + mchar + ' != ' + gchar);
|
| + status.log('charcodes: ' + mchar.charCodeAt(0) + ' != ' + gchar.charCodeAt(0));
|
| + }
|
| + }
|
| + status.assertEqual(message_event.data, golden);
|
| + status.pass();
|
| + }, false);
|
| + plugin.postMessage('manifest_data');
|
| + });
|
| +}
|
| +
|
| +var tester = new Tester();
|
| +setupTests(tester, $('naclModule'));
|
| +tester.waitFor($('naclModule'));
|
| +tester.run();
|
| + //]]>
|
| + </script>
|
| + </body>
|
| +</html>
|
|
|