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

Unified Diff: content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java

Issue 2769993002: Restrict getInstalledRelatedApps() to non-incognito contexts. (Closed)
Patch Set: fix variable name + todo Created 3 years, 9 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 | « content/public/android/java/src/org/chromium/content/browser/installedapp/InstalledAppProviderImpl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java
diff --git a/content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java b/content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java
index 583c868c4561a5eaf33d24aece78e7629cfc8a7a..29c67c7a308ca477cdca52999f5835c8dbf75f82 100644
--- a/content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java
+++ b/content/public/android/junit/src/org/chromium/content/browser/installedapp/InstalledAppProviderTest.java
@@ -162,6 +162,7 @@ public class InstalledAppProviderTest {
private static final class FakeFrameUrlDelegate
implements InstalledAppProviderImpl.FrameUrlDelegate {
private URI mFrameUrl;
+ private boolean mIncognito;
public FakeFrameUrlDelegate(String frameUrl) {
setFrameUrl(frameUrl);
@@ -184,6 +185,15 @@ public class InstalledAppProviderTest {
public URI getUrl() {
return mFrameUrl;
}
+
+ public void setIncognito(boolean incognito) {
+ mIncognito = incognito;
+ }
+
+ @Override
+ public boolean isIncognito() {
+ return mIncognito;
+ }
}
/**
@@ -290,6 +300,21 @@ public class InstalledAppProviderTest {
}
/**
+ * Incognito mode with one related Android app.
+ */
+ @Test
+ @Feature({"InstalledApp"})
+ public void testIncognitoWithOneInstalledRelatedApp() {
+ RelatedApplication manifestRelatedApps[] = new RelatedApplication[] {
+ createRelatedApplication(PLATFORM_ANDROID, PACKAGE_NAME_1, null)};
+ setAssetStatement(PACKAGE_NAME_1, NAMESPACE_WEB, RELATION_HANDLE_ALL_URLS, ORIGIN);
+ RelatedApplication[] expectedInstalledRelatedApps = new RelatedApplication[] {};
+
+ mFrameUrlDelegate.setIncognito(true);
+ verifyInstalledApps(manifestRelatedApps, expectedInstalledRelatedApps);
+ }
+
+ /**
* No related Android apps.
*
* An Android app relates to the web app, but not mutual.
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/installedapp/InstalledAppProviderImpl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698