Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / platform_apps / app_view / shim / main.js
index f305dca..fe3c2eb 100644 (file)
@@ -71,11 +71,13 @@ embedder.test.assertFalse = function(condition) {
 function testAppViewWithUndefinedDataShouldSucceed(appToEmbed) {
   var appview = new AppView();
   LOG('appToEmbed  ' + appToEmbed);
+  document.body.appendChild(appview);
   // Step 1: Attempt to connect to a non-existant app.
   LOG('attempting to connect to non-existant app.');
   appview.connect('abc123', undefined, function(success) {
     // Make sure we fail.
     if (success) {
+      LOG('UNEXPECTED CONNECTION.');
       embedder.test.fail();
       return;
     }
@@ -85,44 +87,49 @@ function testAppViewWithUndefinedDataShouldSucceed(appToEmbed) {
     appview.connect(appToEmbed, undefined, function(success) {
       // Make sure we don't fail.
       if (!success) {
+        LOG('FAILED TO CONNECT.');
         embedder.test.fail();
         return;
       }
+      LOG('CONNECTED.');
       embedder.test.succeed();
     });
   });
-  document.body.appendChild(appview);
 };
 
 function testAppViewRefusedDataShouldFail(appToEmbed) {
   var appview = new AppView();
   LOG('appToEmbed  ' + appToEmbed);
+  document.body.appendChild(appview);
   LOG('Attempting to connect to app with refused params.');
   appview.connect(appToEmbed, { 'foo': 'bar' }, function(success) {
     // Make sure we fail.
     if (success) {
+      LOG('UNEXPECTED CONNECTION.');
       embedder.test.fail();
       return;
     }
+    LOG('FAILED TO CONNECT.');
     embedder.test.succeed();
   });
-  document.body.appendChild(appview);
 };
 
 function testAppViewGoodDataShouldSucceed(appToEmbed) {
   var appview = new AppView();
   LOG('appToEmbed  ' + appToEmbed);
+  document.body.appendChild(appview);
   LOG('Attempting to connect to app with good params.');
   // Step 2: Attempt to connect to an app with good params.
   appview.connect(appToEmbed, { 'foo': 'bleep' }, function(success) {
     // Make sure we don't fail.
     if (!success) {
+      LOG('FAILED TO CONNECT.');
       embedder.test.fail();
       return;
     }
+    LOG('CONNECTED.');
     embedder.test.succeed();
   });
-  document.body.appendChild(appview);
 };
 
 embedder.test.testList = {