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

Unified Diff: tests/ppapi_test_example/ppapi_test_example.js

Issue 7292002: Remove plugin connection to PPAPI scriptable objects (var deprecated). Also (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 5 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_test_example/ppapi_test_example.cc ('k') | tests/ppapi_test_lib/get_browser_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ppapi_test_example/ppapi_test_example.js
===================================================================
--- tests/ppapi_test_example/ppapi_test_example.js (revision 6005)
+++ tests/ppapi_test_example/ppapi_test_example.js (working copy)
@@ -5,62 +5,37 @@
function setupTests(tester, plugin) {
// TODO(tester): replace with your tests.
- // Below are the before & after versions of sample test cases demonstrating
- // how to transition from synchronous scripting to postMessage as the test
+ // Below are sample test cases demonstrating postMessage as the test
// driving mechanism.
- // Before.
- tester.addTest('Example::SimpleSync', function() {
- assert(plugin.TestSimpleSync());
- });
-
- // After.
- tester.addAsyncTest('Example::SimpleAsync', function(status) {
+ tester.addAsyncTest('Example::Simple', function(status) {
var messageListener = status.wrap(function(message) {
status.log('Received message: ' + message.data);
plugin.removeEventListener('message', messageListener, false);
- status.assertEqual(message.data, 'TestSimpleAsync:PASSED');
+ status.assertEqual(message.data, 'TestSimple:PASSED');
status.pass();
});
plugin.addEventListener("message", messageListener, false);
- plugin.postMessage("TestSimpleAsync");
+ plugin.postMessage("TestSimple");
});
- // Before.
- tester.addTest('Example::CallbackSync', function(status) {
- status.assert(plugin.TestCallbackSync());
- status.waitForCallback('CallbackSync', 1);
- });
-
- // After.
- tester.addAsyncTest('Example::CallbackAsync', function(status) {
+ tester.addAsyncTest('Example::Callback', function(status) {
var gotPassed = false;
var messageListener = status.wrap(function(message) {
- // <IGNORE>
- // If you are consulting this example while porting or writing
- // addAsyncTest's, ignore this part. This is a short-term side-effect of
- // C++ test harness migration and affects only this example
- // that uses both old-style and new-style tests.
- // To simplify C++ test harness migration, the callback handler
- // notifies JS both via browser scripting and postMessage,
- // so we should ignore the message from TestCallbackSync above.
- if (message.data == 'CallbackSync')
- return;
- // </IGNORE>
status.log('Received message: ' + message.data);
plugin.removeEventListener('message', messageListener, false);
if (!gotPassed) {
- status.assertEqual(message.data, 'TestCallbackAsync:PASSED');
+ status.assertEqual(message.data, 'TestCallback:PASSED');
gotPassed = true;
plugin.addEventListener("message", messageListener, false);
} else {
- status.assertEqual(message.data, 'CallbackAsync');
+ status.assertEqual(message.data, 'Callback');
status.pass();
}
});
plugin.addEventListener("message", messageListener, false);
- plugin.postMessage("TestCallbackAsync");
+ plugin.postMessage("TestCallback");
});
}
« no previous file with comments | « tests/ppapi_test_example/ppapi_test_example.cc ('k') | tests/ppapi_test_lib/get_browser_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698