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

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
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | chrome/test/ppapi/ppapi_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ppapi/ppapi_browsertest.cc
diff --git a/chrome/test/ppapi/ppapi_browsertest.cc b/chrome/test/ppapi/ppapi_browsertest.cc
index 964d0e7a6cacdb307178b6d731de1d52d1151c2d..edcc08624925d040c0a5dac19f6f767e52d1d41b 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)
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | chrome/test/ppapi/ppapi_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698