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

Unified Diff: chrome/test/ppapi/ppapi_browsertest.cc

Issue 11316316: Implement an IsAllowed function in the pepper PPB_Broker_Trusted API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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/ppapi/ppapi_browsertest.cc
diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc
index 2fbb19b1f5f1c01255aa1710fc5824ad3f6f3105..fe60dc6d0896e61d21c9c4a70bb603a7882104ac 100644
--- a/chrome/test/ppapi/ppapi_browsertest.cc
+++ b/chrome/test/ppapi/ppapi_browsertest.cc
@@ -143,10 +143,14 @@ IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Accept) {
InfoBarObserver observer;
observer.ExpectInfoBarAndAccept(true);
- GURL url = GetTestFileUrl("Broker_ConnectPermissionGranted");
- RunTestURL(url);
+ // PPB_Broker_Trusted::IsAllowed should return false before the infobar is
+ // popped and true after the infobar is popped.
+ RunTest("Broker_IsAllowedPermissionDenied");
+ RunTest("Broker_ConnectPermissionGranted");
+ RunTest("Broker_IsAllowedPermissionGranted");
// It should also set a content settings exception for the site.
+ GURL url = GetTestFileUrl("Broker_ConnectPermissionGranted");
HostContentSettingsMap* content_settings =
browser()->profile()->GetHostContentSettingsMap();
EXPECT_EQ(CONTENT_SETTING_ALLOW,
@@ -159,10 +163,14 @@ IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Deny) {
InfoBarObserver observer;
observer.ExpectInfoBarAndAccept(false);
- GURL url = GetTestFileUrl("Broker_ConnectPermissionDenied");
- RunTestURL(url);
+ // PPB_Broker_Trusted::IsAllowed should return false before and after the
+ // infobar is popped.
+ RunTest("Broker_IsAllowedPermissionDenied");
+ RunTest("Broker_ConnectPermissionDenied");
+ RunTest("Broker_IsAllowedPermissionDenied");
// It should also set a content settings exception for the site.
+ GURL url = GetTestFileUrl("Broker_ConnectPermissionDenied");
HostContentSettingsMap* content_settings =
browser()->profile()->GetHostContentSettingsMap();
EXPECT_EQ(CONTENT_SETTING_BLOCK,
@@ -179,6 +187,7 @@ IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Blocked) {
InfoBarObserver observer;
RunTest("Broker_ConnectPermissionDenied");
+ RunTest("Broker_IsAllowedPermissionDenied");
}
IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Allowed) {
@@ -190,6 +199,7 @@ IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Allowed) {
InfoBarObserver observer;
RunTest("Broker_ConnectPermissionGranted");
+ RunTest("Broker_IsAllowedPermissionGranted");
}
TEST_PPAPI_IN_PROCESS(Core)

Powered by Google App Engine
This is Rietveld 408576698