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

Side by Side Diff: content/browser/in_process_webkit/indexed_db_browsertest.cc

Issue 10795090: Move ExecuteJavaScript functions from ui_test_utils.h to browser_test_utils.h so they can be reused… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/scoped_temp_dir.h" 11 #include "base/scoped_temp_dir.h"
12 #include "base/test/thread_test_helper.h" 12 #include "base/test/thread_test_helper.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/browser_tabstrip.h" 15 #include "chrome/browser/ui/browser_tabstrip.h"
16 #include "chrome/test/base/in_process_browser_test.h" 16 #include "chrome/test/base/in_process_browser_test.h"
17 #include "chrome/test/base/testing_profile.h" 17 #include "chrome/test/base/testing_profile.h"
18 #include "chrome/test/base/ui_test_utils.h" 18 #include "chrome/test/base/ui_test_utils.h"
19 #include "content/browser/in_process_webkit/indexed_db_context_impl.h" 19 #include "content/browser/in_process_webkit/indexed_db_context_impl.h"
20 #include "content/browser/web_contents/web_contents_impl.h" 20 #include "content/browser/web_contents/web_contents_impl.h"
21 #include "content/public/common/content_paths.h" 21 #include "content/public/common/content_paths.h"
22 #include "content/public/common/content_switches.h" 22 #include "content/public/common/content_switches.h"
23 #include "content/public/test/browser_test_utils.h"
23 #include "net/base/net_util.h" 24 #include "net/base/net_util.h"
24 #include "webkit/database/database_util.h" 25 #include "webkit/database/database_util.h"
25 #include "webkit/quota/mock_special_storage_policy.h" 26 #include "webkit/quota/mock_special_storage_policy.h"
26 #include "webkit/quota/quota_manager.h" 27 #include "webkit/quota/quota_manager.h"
27 #include "webkit/quota/special_storage_policy.h" 28 #include "webkit/quota/special_storage_policy.h"
28 29
29 using content::BrowserContext; 30 using content::BrowserContext;
30 using content::BrowserThread; 31 using content::BrowserThread;
31 using quota::QuotaManager; 32 using quota::QuotaManager;
32 using webkit_database::DatabaseUtil; 33 using webkit_database::DatabaseUtil;
(...skipping 17 matching lines...) Expand all
50 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); 51 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser();
51 52
52 LOG(INFO) << "Navigating to URL and blocking."; 53 LOG(INFO) << "Navigating to URL and blocking.";
53 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( 54 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(
54 the_browser, test_url, 2); 55 the_browser, test_url, 2);
55 LOG(INFO) << "Navigation done."; 56 LOG(INFO) << "Navigation done.";
56 std::string result = 57 std::string result =
57 chrome::GetActiveWebContents(the_browser)->GetURL().ref(); 58 chrome::GetActiveWebContents(the_browser)->GetURL().ref();
58 if (result != "pass") { 59 if (result != "pass") {
59 std::string js_result; 60 std::string js_result;
60 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( 61 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
61 chrome::GetActiveWebContents(the_browser)->GetRenderViewHost(), L"", 62 chrome::GetActiveWebContents(the_browser)->GetRenderViewHost(), L"",
62 L"window.domAutomationController.send(getLog())", &js_result)); 63 L"window.domAutomationController.send(getLog())", &js_result));
63 FAIL() << "Failed: " << js_result; 64 FAIL() << "Failed: " << js_result;
64 } 65 }
65 } 66 }
66 }; 67 };
67 68
68 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) { 69 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) {
69 SimpleTest(GetTestURL(FilePath(FILE_PATH_LITERAL("cursor_test.html")))); 70 SimpleTest(GetTestURL(FilePath(FILE_PATH_LITERAL("cursor_test.html"))));
70 } 71 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 virtual void SetUpCommandLine(CommandLine* command_line) { 180 virtual void SetUpCommandLine(CommandLine* command_line) {
180 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc"); 181 command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose-gc");
181 } 182 }
182 }; 183 };
183 184
184 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed, 185 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithGCExposed,
185 DatabaseCallbacksTest) { 186 DatabaseCallbacksTest) {
186 SimpleTest( 187 SimpleTest(
187 GetTestURL(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html")))); 188 GetTestURL(FilePath(FILE_PATH_LITERAL("database_callbacks_first.html"))));
188 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698