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

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

Issue 568823003: Merge Android RetrieveWebappInformation and Extensions GetApplicationInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@manifest_manager_content
Patch Set: Created 6 years, 3 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 | « no previous file | chrome/browser/android/shortcut_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/ShortcutHelperTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ShortcutHelperTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ShortcutHelperTest.java
index 2321794d2c023f78b7337cc387c3cfdfc02a2c80..addf158cd805e2d9dee975a49dc11f68329d595b 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ShortcutHelperTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ShortcutHelperTest.java
@@ -42,6 +42,14 @@ public class ShortcutHelperTest extends ChromeShellTestBase {
+ "<head><title>" + NORMAL_TITLE + "</title></head>"
+ "<body>Not Webapp capable</body></html>");
+ private static final String META_APP_NAME_TITLE = "Web application-name";
+ private static final String META_APP_NAME_HTML = UrlUtils.encodeHtmlDataUri(
+ "<html><head>"
+ + "<meta name=\"mobile-web-app-capable\" content=\"yes\" />"
+ + "<meta name=\"application-name\" content=\"" + META_APP_NAME_TITLE + "\">"
+ + "<title>Not the right title</title>"
+ + "</head><body>Webapp capable</body></html>");
+
private static class TestObserver implements ChromeShellApplicationObserver {
Intent mFiredIntent;
@@ -153,6 +161,19 @@ public class ShortcutHelperTest extends ChromeShellTestBase {
assertEquals(EDITED_WEBAPP_TITLE , firedIntent.getStringExtra(Intent.EXTRA_SHORTCUT_NAME));
}
+ /**
+ * @MediumTest
+ * @Feature("{Webapp}")
+ * crbug.com/303486
+ */
+ @FlakyTest
+ public void testAddWebappShortcutsWithApplicationName() throws InterruptedException {
+ // Add a webapp shortcut to check edited title.
+ addShortcutToURL(META_APP_NAME_HTML, "");
+ Intent firedIntent = mTestObserver.mFiredIntent;
+ assertEquals(META_APP_NAME_TITLE , firedIntent.getStringExtra(Intent.EXTRA_SHORTCUT_NAME));
+ }
+
private void addShortcutToURL(String url, final String title) throws InterruptedException {
loadUrlWithSanitization(url);
assertTrue(waitForActiveShellToBeDoneLoading());
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698