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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc

Issue 16295003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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/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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 private: 79 private:
80 BrowsingDataDatabaseHelper* database_helper_; 80 BrowsingDataDatabaseHelper* database_helper_;
81 }; 81 };
82 82
83 // Flaky on Win/Mac/Linux: http://crbug.com/92460 83 // Flaky on Win/Mac/Linux: http://crbug.com/92460
84 IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, DISABLED_FetchData) { 84 IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, DISABLED_FetchData) {
85 CreateDatabases(); 85 CreateDatabases();
86 scoped_refptr<BrowsingDataDatabaseHelper> database_helper( 86 scoped_refptr<BrowsingDataDatabaseHelper> database_helper(
87 new BrowsingDataDatabaseHelper(browser()->profile())); 87 new BrowsingDataDatabaseHelper(browser()->profile()));
88 StopTestOnCallback stop_test_on_callback(database_helper); 88 StopTestOnCallback stop_test_on_callback(database_helper.get());
89 database_helper->StartFetching( 89 database_helper->StartFetching(base::Bind(
90 base::Bind(&StopTestOnCallback::Callback, 90 &StopTestOnCallback::Callback, base::Unretained(&stop_test_on_callback)));
91 base::Unretained(&stop_test_on_callback)));
92 // Blocks until StopTestOnCallback::Callback is notified. 91 // Blocks until StopTestOnCallback::Callback is notified.
93 content::RunMessageLoop(); 92 content::RunMessageLoop();
94 } 93 }
95 94
96 IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedAddDatabase) { 95 IN_PROC_BROWSER_TEST_F(BrowsingDataDatabaseHelperTest, CannedAddDatabase) {
97 const GURL origin1("http://host1:1/"); 96 const GURL origin1("http://host1:1/");
98 const GURL origin2("http://host2:1/"); 97 const GURL origin2("http://host2:1/");
99 const char origin_str1[] = "http_host1_1"; 98 const char origin_str1[] = "http_host1_1";
100 const char origin_str2[] = "http_host2_1"; 99 const char origin_str2[] = "http_host2_1";
101 const char db1[] = "db1"; 100 const char db1[] = "db1";
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 base::Unretained(&callback))); 144 base::Unretained(&callback)));
146 145
147 std::list<BrowsingDataDatabaseHelper::DatabaseInfo> result = 146 std::list<BrowsingDataDatabaseHelper::DatabaseInfo> result =
148 callback.result(); 147 callback.result();
149 148
150 ASSERT_EQ(1u, result.size()); 149 ASSERT_EQ(1u, result.size());
151 EXPECT_STREQ(origin_str, result.begin()->origin_identifier.c_str()); 150 EXPECT_STREQ(origin_str, result.begin()->origin_identifier.c_str());
152 EXPECT_STREQ(db, result.begin()->database_name.c_str()); 151 EXPECT_STREQ(db, result.begin()->database_name.c_str());
153 } 152 }
154 } // namespace 153 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698