OLD | NEW |
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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/test/thread_test_helper.h" | 9 #include "base/test/thread_test_helper.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 void SimpleTest(const GURL& test_url, bool incognito = false) { | 34 void SimpleTest(const GURL& test_url, bool incognito = false) { |
35 // The test page will perform tests on FileAPI, then navigate to either | 35 // The test page will perform tests on FileAPI, then navigate to either |
36 // a #pass or #fail ref. | 36 // a #pass or #fail ref. |
37 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); | 37 Browser* the_browser = incognito ? CreateIncognitoBrowser() : browser(); |
38 | 38 |
39 LOG(INFO) << "Navigating to URL and blocking."; | 39 LOG(INFO) << "Navigating to URL and blocking."; |
40 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 40 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
41 the_browser, test_url, 2); | 41 the_browser, test_url, 2); |
42 LOG(INFO) << "Navigation done."; | 42 LOG(INFO) << "Navigation done."; |
43 std::string result = the_browser->GetSelectedWebContents()->GetURL().ref(); | 43 std::string result = the_browser->GetActiveWebContents()->GetURL().ref(); |
44 if (result != "pass") { | 44 if (result != "pass") { |
45 std::string js_result; | 45 std::string js_result; |
46 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( | 46 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( |
47 the_browser->GetSelectedWebContents()->GetRenderViewHost(), L"", | 47 the_browser->GetActiveWebContents()->GetRenderViewHost(), L"", |
48 L"window.domAutomationController.send(getLog())", &js_result)); | 48 L"window.domAutomationController.send(getLog())", &js_result)); |
49 FAIL() << "Failed: " << js_result; | 49 FAIL() << "Failed: " << js_result; |
50 } | 50 } |
51 } | 51 } |
52 }; | 52 }; |
53 | 53 |
54 class FileSystemBrowserTestWithLowQuota : public FileSystemBrowserTest { | 54 class FileSystemBrowserTestWithLowQuota : public FileSystemBrowserTest { |
55 public: | 55 public: |
56 virtual void SetUpOnMainThread() { | 56 virtual void SetUpOnMainThread() { |
57 const int kInitialQuotaKilobytes = 5000; | 57 const int kInitialQuotaKilobytes = 5000; |
(...skipping 26 matching lines...) Expand all Loading... |
84 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("request_test.html")))); | 84 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("request_test.html")))); |
85 } | 85 } |
86 | 86 |
87 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { | 87 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTest, CreateTest) { |
88 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("create_test.html")))); | 88 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("create_test.html")))); |
89 } | 89 } |
90 | 90 |
91 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { | 91 IN_PROC_BROWSER_TEST_F(FileSystemBrowserTestWithLowQuota, QuotaTest) { |
92 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("quota_test.html")))); | 92 SimpleTest(testUrl(FilePath(FILE_PATH_LITERAL("quota_test.html")))); |
93 } | 93 } |
OLD | NEW |