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