diff options
Diffstat (limited to 'chrome/test/ui')
-rw-r--r-- | chrome/test/ui/npapi_test_helper.cc | 8 | ||||
-rw-r--r-- | chrome/test/ui/npapi_test_helper.h | 6 | ||||
-rw-r--r-- | chrome/test/ui/npapi_uitest.cpp | 24 |
3 files changed, 36 insertions, 2 deletions
diff --git a/chrome/test/ui/npapi_test_helper.cc b/chrome/test/ui/npapi_test_helper.cc index c6753d0..859d3df 100644 --- a/chrome/test/ui/npapi_test_helper.cc +++ b/chrome/test/ui/npapi_test_helper.cc @@ -31,6 +31,8 @@ #include "chrome/test/ui/npapi_test_helper.h" +#include "chrome/common/chrome_switches.h" + NPAPITester::NPAPITester() : UITest() { } @@ -59,3 +61,9 @@ void NPAPIVisiblePluginTester::SetUp() { show_window_ = true; NPAPITester::SetUp(); } + +// NPAPIIncognitoTester members. +void NPAPIIncognitoTester::SetUp() { + launch_arguments_.AppendSwitch(switches::kIncognito); + NPAPITester::SetUp(); +} diff --git a/chrome/test/ui/npapi_test_helper.h b/chrome/test/ui/npapi_test_helper.h index 26f4c67..7b79e0e 100644 --- a/chrome/test/ui/npapi_test_helper.h +++ b/chrome/test/ui/npapi_test_helper.h @@ -46,3 +46,9 @@ class NPAPIVisiblePluginTester : public NPAPITester { protected: virtual void SetUp(); }; + +// Helper class for NPAPI plugin UI tests which use incognito mode. +class NPAPIIncognitoTester : public NPAPITester { + protected: + virtual void SetUp(); +}; diff --git a/chrome/test/ui/npapi_uitest.cpp b/chrome/test/ui/npapi_uitest.cpp index 8d808be..7826878 100644 --- a/chrome/test/ui/npapi_uitest.cpp +++ b/chrome/test/ui/npapi_uitest.cpp @@ -76,7 +76,6 @@ TEST_F(NPAPITester, Arguments) { kTestCompleteSuccess, kShortWaitTimeout); } - // Test invoking many plugins within a single page. TEST_F(NPAPITester, ManyPlugins) { std::wstring test_case = L"many_plugins.html"; @@ -134,7 +133,6 @@ TEST_F(NPAPITester, GetJavaScriptURL) { kTestCompleteSuccess, kShortWaitTimeout); } - // Tests that if an NPObject is proxies back to its original process, the // original pointer is returned and not a proxy. If this fails the plugin // will crash. @@ -261,3 +259,25 @@ TEST_F(NPAPIVisiblePluginTester, OpenPopupWindowWithPlugin) { kTestCompleteCookie, kTestCompleteSuccess, action_timeout_ms()); } + +// Test checking the privacy mode is off. +TEST_F(NPAPITester, PrivateDisabled) { + if (UITest::in_process_renderer()) + return; + + GURL url = GetTestUrl(L"npapi", L"private.html"); + NavigateToURL(url); + WaitForFinish("private", "1", url, kTestCompleteCookie, + kTestCompleteSuccess, kShortWaitTimeout); +} + +// Test checking the privacy mode is on. +TEST_F(NPAPIIncognitoTester, PrivateEnabled) { + if (UITest::in_process_renderer()) + return; + + GURL url = GetTestUrl(L"npapi", L"private.html?secure"); + NavigateToURL(url); + WaitForFinish("private", "1", url, kTestCompleteCookie, + kTestCompleteSuccess, kShortWaitTimeout); +} |