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

Unified Diff: tests/ppapi_file_system/ppapi_file_system.js

Issue 7167018: Migrating test/ppapi_file_system to messaging (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 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
« no previous file with comments | « tests/ppapi_file_system/ppapi_file_system.html ('k') | tests/ppapi_file_system/scriptable_object.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ppapi_file_system/ppapi_file_system.js
===================================================================
--- tests/ppapi_file_system/ppapi_file_system.js (revision 0)
+++ tests/ppapi_file_system/ppapi_file_system.js (revision 0)
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 The Native Client Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function setupTests(tester, plugin) {
+ tester.addAsyncTest('TestCreate', function(status) {
+ var messageListener = status.wrap(function(message) {
+ status.log('Received message: ' + message.data);
+ plugin.removeEventListener('message', messageListener, false);
+ status.assertEqual(message.data, 'TestCreate:PASSED');
+ status.pass();
+ });
+ plugin.addEventListener("message", messageListener, false);
+ plugin.postMessage("TestCreate");
+ });
+ tester.addAsyncTest('TestIsFileSystem', function(status) {
+ var messageListener = status.wrap(function(message) {
+ status.log('Received message: ' + message.data);
+ plugin.removeEventListener('message', messageListener, false);
+ status.assertEqual(message.data, 'TestIsFileSystem:PASSED');
+ status.pass();
+ });
+ plugin.addEventListener("message", messageListener, false);
+ plugin.postMessage("TestIsFileSystem");
+ });
+ tester.addAsyncTest('TestGetType', function(status) {
+ var messageListener = status.wrap(function(message) {
+ status.log('Received message: ' + message.data);
+ plugin.removeEventListener('message', messageListener, false);
+ status.assertEqual(message.data, 'TestGetType:PASSED');
+ status.pass();
+ });
+ plugin.addEventListener("message", messageListener, false);
+ plugin.postMessage("TestGetType");
+ });
+ tester.addAsyncTest('TestOpen', function(status) {
+ var gotPassed = false;
+ var messageListener = status.wrap(function(message) {
+ status.log('Received message: ' + message.data);
+ plugin.removeEventListener('message', messageListener, false);
+ if (!gotPassed) {
+ status.assertEqual(message.data, 'TestOpen:PASSED');
+ gotPassed = true;
+ plugin.addEventListener("message", messageListener, false);
+ } else {
+ status.assertEqual(message.data, 'OpenCallback');
+ status.pass();
+ }
+ });
+ plugin.addEventListener("message", messageListener, false);
+ plugin.postMessage("TestOpen");
+ });
+}
« no previous file with comments | « tests/ppapi_file_system/ppapi_file_system.html ('k') | tests/ppapi_file_system/scriptable_object.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698