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/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 7 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
8 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 8 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 download_manager, 1, | 78 download_manager, 1, |
79 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); | 79 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); |
80 | 80 |
81 GURL download_url = ui_test_utils::GetTestUrl( | 81 GURL download_url = ui_test_utils::GetTestUrl( |
82 FilePath().AppendASCII("downloads"), | 82 FilePath().AppendASCII("downloads"), |
83 FilePath().AppendASCII("a_zip_file.zip")); | 83 FilePath().AppendASCII("a_zip_file.zip")); |
84 ui_test_utils::NavigateToURL(browser(), download_url); | 84 ui_test_utils::NavigateToURL(browser(), download_url); |
85 observer->WaitForFinished(); | 85 observer->WaitForFinished(); |
86 | 86 |
87 std::vector<content::DownloadItem*> downloads; | 87 std::vector<content::DownloadItem*> downloads; |
88 download_manager->GetAllDownloads(FilePath(), &downloads); | 88 download_manager->GetAllDownloads(&downloads); |
89 EXPECT_EQ(1u, downloads.size()); | 89 EXPECT_EQ(1u, downloads.size()); |
90 | 90 |
91 RemoveAndWait(BrowsingDataRemover::REMOVE_DOWNLOADS); | 91 RemoveAndWait(BrowsingDataRemover::REMOVE_DOWNLOADS); |
92 | 92 |
93 downloads.clear(); | 93 downloads.clear(); |
94 download_manager->GetAllDownloads(FilePath(), &downloads); | 94 download_manager->GetAllDownloads(&downloads); |
95 EXPECT_TRUE(downloads.empty()); | 95 EXPECT_TRUE(downloads.empty()); |
96 } | 96 } |
97 | 97 |
98 // Verify can modify database after deleting it. | 98 // Verify can modify database after deleting it. |
99 IN_PROC_BROWSER_TEST_F(BrowsingDataRemoverBrowserTest, Database) { | 99 IN_PROC_BROWSER_TEST_F(BrowsingDataRemoverBrowserTest, Database) { |
100 GURL url(URLRequestMockHTTPJob::GetMockUrl( | 100 GURL url(URLRequestMockHTTPJob::GetMockUrl( |
101 FilePath().AppendASCII("simple_database.html"))); | 101 FilePath().AppendASCII("simple_database.html"))); |
102 ui_test_utils::NavigateToURL(browser(), url); | 102 ui_test_utils::NavigateToURL(browser(), url); |
103 | 103 |
104 RunScriptAndCheckResult(L"createTable()", "done"); | 104 RunScriptAndCheckResult(L"createTable()", "done"); |
105 RunScriptAndCheckResult(L"insertRecord('text')", "done"); | 105 RunScriptAndCheckResult(L"insertRecord('text')", "done"); |
106 RunScriptAndCheckResult(L"getRecords()", "text"); | 106 RunScriptAndCheckResult(L"getRecords()", "text"); |
107 | 107 |
108 RemoveAndWait(BrowsingDataRemover::REMOVE_SITE_DATA); | 108 RemoveAndWait(BrowsingDataRemover::REMOVE_SITE_DATA); |
109 | 109 |
110 ui_test_utils::NavigateToURL(browser(), url); | 110 ui_test_utils::NavigateToURL(browser(), url); |
111 RunScriptAndCheckResult(L"createTable()", "done"); | 111 RunScriptAndCheckResult(L"createTable()", "done"); |
112 RunScriptAndCheckResult(L"insertRecord('text2')", "done"); | 112 RunScriptAndCheckResult(L"insertRecord('text2')", "done"); |
113 RunScriptAndCheckResult(L"getRecords()", "text2"); | 113 RunScriptAndCheckResult(L"getRecords()", "text2"); |
114 } | 114 } |
OLD | NEW |