summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-16 14:41:17 +0000
committerhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-16 14:41:17 +0000
commit584b69df8dd7aa9eb334a5b3a7fd076839f54a0a (patch)
tree2d2894025c9ab20c5367bc8289add4dd430f9b3d /content
parentc211c1b625ddfa038e960d566d03c65dbee514e2 (diff)
downloadchromium_src-584b69df8dd7aa9eb334a5b3a7fd076839f54a0a.zip
chromium_src-584b69df8dd7aa9eb334a5b3a7fd076839f54a0a.tar.gz
chromium_src-584b69df8dd7aa9eb334a5b3a7fd076839f54a0a.tar.bz2
IndexedDB: Add browser test using LevelDB in incognito mode.
This depends on WebKit r88921. BUG=81383 TEST=browser_tests Review URL: http://codereview.chromium.org/7170016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89334 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/in_process_webkit/indexed_db_browsertest.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc
index 9670a37..03debd0 100644
--- a/content/browser/in_process_webkit/indexed_db_browsertest.cc
+++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc
@@ -35,18 +35,20 @@ class IndexedDBBrowserTest : public InProcessBrowserTest {
return ui_test_utils::GetTestUrl(kTestDir, file_path);
}
- void SimpleTest(const GURL& test_url) {
+ void SimpleTest(const GURL& test_url, bool incognito = false) {
// The test page will perform tests on IndexedDB, then navigate to either
// a #pass or #fail ref.
+ Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser();
+
LOG(INFO) << "Navigating to URL and blocking.";
ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(
- browser(), test_url, 2);
+ the_browser, test_url, 2);
LOG(INFO) << "Navigation done.";
- std::string result = browser()->GetSelectedTabContents()->GetURL().ref();
+ std::string result = the_browser->GetSelectedTabContents()->GetURL().ref();
if (result != "pass") {
std::string js_result;
ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
- browser()->GetSelectedTabContents()->render_view_host(), L"",
+ the_browser->GetSelectedTabContents()->render_view_host(), L"",
L"window.domAutomationController.send(getLog())", &js_result));
FAIL() << "Failed: " << js_result;
}
@@ -68,6 +70,11 @@ IN_PROC_BROWSER_TEST_F(IndexedDBLevelDBBrowserTest, CursorTest) {
SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html"))));
}
+IN_PROC_BROWSER_TEST_F(IndexedDBLevelDBBrowserTest, CursorTestIncognito) {
+ SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("cursor_test.html"))),
+ true /* incognito */);
+}
+
// Flaky: http://crbug.com/70773
IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, DISABLED_IndexTest) {
SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("index_test.html"))));