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

Unified Diff: chrome/test/data/extensions/platform_apps/app_view/shim/main.js

Issue 460133002: Allow passing parameters within appview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed spacing Created 6 years, 4 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
Index: chrome/test/data/extensions/platform_apps/app_view/shim/main.js
diff --git a/chrome/test/data/extensions/platform_apps/app_view/shim/main.js b/chrome/test/data/extensions/platform_apps/app_view/shim/main.js
index 8a2f041e2388b4cfead08fe89001deac5655b4dc..36efcf402bcaecefa9da71d7fb00ed00ce0c1612 100644
--- a/chrome/test/data/extensions/platform_apps/app_view/shim/main.js
+++ b/chrome/test/data/extensions/platform_apps/app_view/shim/main.js
@@ -73,7 +73,7 @@ function testAppViewBasic(appToEmbed) {
LOG('appToEmbed ' + appToEmbed);
// Step 1: Attempt to connect to a non-existant app.
LOG('attempting to connect to non-existant app.');
- appview.connect('abc123', function(success) {
+ appview.connect('abc123', {}, function(success) {
// Make sure we fail.
if (success) {
embedder.test.fail();
@@ -82,7 +82,32 @@ function testAppViewBasic(appToEmbed) {
LOG('failed to connect to non-existant app.');
LOG('attempting to connect to known app.');
// Step 2: Attempt to connect to an app we know exists.
- appview.connect(appToEmbed, function(success) {
+ appview.connect(appToEmbed, {}, function(success) {
+ // Make sure we don't fail.
+ if (!success) {
+ embedder.test.fail();
+ return;
+ }
+ embedder.test.succeed();
+ });
+ });
+ document.body.appendChild(appview);
+};
+
+// Tests begin.
+function testAppViewParams(appToEmbed) {
+ var appview = new AppView();
+ LOG('appToEmbed ' + appToEmbed);
+ // Step 1: Attempt to connect to an app with refused params.
+ LOG('attempting to connect to app with refused params.');
+ appview.connect(appToEmbed, { 'foo': 'bar' }, function(success) {
+ // Make sure we fail.
+ if (success) {
+ embedder.test.fail();
+ return;
+ }
+ // Step 2: Attempt to connect to an app with good params.
+ appview.connect(appToEmbed, { 'foo': 'bleep' }, function(success) {
Xi Han 2014/08/12 18:52:18 I think the step 2 shouldn't be a part of the call
// Make sure we don't fail.
if (!success) {
embedder.test.fail();
@@ -95,7 +120,8 @@ function testAppViewBasic(appToEmbed) {
};
embedder.test.testList = {
- 'testAppViewBasic': testAppViewBasic
+ 'testAppViewBasic': testAppViewBasic,
+ 'testAppViewParams': testAppViewParams
Xi Han 2014/08/12 18:52:18 Maybe we can split the second test as two, like: t
};
onload = function() {

Powered by Google App Engine
This is Rietveld 408576698