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/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
10 #include "chrome/browser/browsing_data/browsing_data_helper_browsertest.h" | 10 #include "chrome/browser/browsing_data/browsing_data_helper_browsertest.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Flaky on Win/Mac/Linux: http://crbug.com/92460 | 80 // Flaky on Win/Mac/Linux: http://crbug.com/92460 |
81 IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, DISABLED_FetchData) { | 81 IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, DISABLED_FetchData) { |
82 CreateDatabases(); | 82 CreateDatabases(); |
83 scoped_refptr<BrowsingDataDatabaseHelper> database_helper( | 83 scoped_refptr<BrowsingDataDatabaseHelper> database_helper( |
84 new BrowsingDataDatabaseHelper(browser()->profile())); | 84 new BrowsingDataDatabaseHelper(browser()->profile())); |
85 StopTestOnCallback stop_test_on_callback(database_helper); | 85 StopTestOnCallback stop_test_on_callback(database_helper); |
86 database_helper->StartFetching( | 86 database_helper->StartFetching( |
87 base::Bind(&StopTestOnCallback::Callback, | 87 base::Bind(&StopTestOnCallback::Callback, |
88 base::Unretained(&stop_test_on_callback))); | 88 base::Unretained(&stop_test_on_callback))); |
89 // Blocks until StopTestOnCallback::Callback is notified. | 89 // Blocks until StopTestOnCallback::Callback is notified. |
90 ui_test_utils::RunMessageLoop(); | 90 content::RunMessageLoop(); |
91 } | 91 } |
92 | 92 |
93 IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedAddDatabase) { | 93 IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedAddDatabase) { |
94 const GURL origin1("http://host1:1/"); | 94 const GURL origin1("http://host1:1/"); |
95 const GURL origin2("http://host2:1/"); | 95 const GURL origin2("http://host2:1/"); |
96 const char origin_str1[] = "http_host1_1"; | 96 const char origin_str1[] = "http_host1_1"; |
97 const char origin_str2[] = "http_host2_1"; | 97 const char origin_str2[] = "http_host2_1"; |
98 const char db1[] = "db1"; | 98 const char db1[] = "db1"; |
99 const char db2[] = "db2"; | 99 const char db2[] = "db2"; |
100 const char db3[] = "db3"; | 100 const char db3[] = "db3"; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 base::Unretained(&callback))); | 142 base::Unretained(&callback))); |
143 | 143 |
144 std::list<BrowsingDataDatabaseHelper::DatabaseInfo> result = | 144 std::list<BrowsingDataDatabaseHelper::DatabaseInfo> result = |
145 callback.result(); | 145 callback.result(); |
146 | 146 |
147 ASSERT_EQ(1u, result.size()); | 147 ASSERT_EQ(1u, result.size()); |
148 EXPECT_STREQ(origin_str, result.begin()->origin_identifier.c_str()); | 148 EXPECT_STREQ(origin_str, result.begin()->origin_identifier.c_str()); |
149 EXPECT_STREQ(db, result.begin()->database_name.c_str()); | 149 EXPECT_STREQ(db, result.begin()->database_name.c_str()); |
150 } | 150 } |
151 } // namespace | 151 } // namespace |
OLD | NEW |