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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 years, 7 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/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..4afa08c0a86bf456dfe157086f8ee355bf59c6b4
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java
@@ -0,0 +1,56 @@
+// Copyright 2015 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.
+
+package org.chromium.chrome.browser.webapps;
+
+import android.content.Intent;
+import android.test.InstrumentationTestCase;
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.chromium.base.test.util.Feature;
+import org.chromium.chrome.browser.ShortcutHelper;
+import org.chromium.content_public.common.ScreenOrientationValues;
+
+/**
+ * Tests the WebappInfo class's ability to parse various URLs.
+ */
+public class WebappInfoTest extends InstrumentationTestCase {
+ @SmallTest
+ @Feature({"Webapps"})
+ public void testAbout() {
+ String id = "webapp id";
+ String title = "webapp title";
+ String url = "about:blank";
+
+ WebappInfo info = WebappInfo.create(id, url, null, title, ScreenOrientationValues.DEFAULT);
+ assertNotNull(info);
+ }
+
+ @SmallTest
+ @Feature({"Webapps"})
+ public void testRandomUrl() {
+ String id = "webapp id";
+ String title = "webapp title";
+ String url = "http://google.com";
+
+ WebappInfo info = WebappInfo.create(id, url, null, title, ScreenOrientationValues.DEFAULT);
+ assertNotNull(info);
+ }
+
+ @SmallTest
+ @Feature({"Webapps"})
+ public void testSpacesInUrl() {
+ String id = "webapp id";
+ String title = "webapp title";
+ String bustedUrl = "http://money.cnn.com/?category=Latest News";
+
+ Intent intent = new Intent();
+ intent.putExtra(ShortcutHelper.EXTRA_ID, id);
+ intent.putExtra(ShortcutHelper.EXTRA_TITLE, title);
+ intent.putExtra(ShortcutHelper.EXTRA_URL, bustedUrl);
+
+ WebappInfo info = WebappInfo.create(intent);
+ assertNotNull(info);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698