| 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 "chrome/browser/browsing_data/browsing_data_database_helper.h" | 5 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | |
| 8 #include "chrome/test/base/testing_profile.h" | 7 #include "chrome/test/base/testing_profile.h" |
| 9 #include "content/public/test/test_browser_thread.h" | 8 #include "content/public/test/test_browser_thread_bundle.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 10 |
| 12 using content::BrowserThread; | |
| 13 | |
| 14 namespace { | 11 namespace { |
| 15 | 12 |
| 16 class CannedBrowsingDataDatabaseHelperTest : public testing::Test { | 13 class CannedBrowsingDataDatabaseHelperTest : public testing::Test { |
| 17 public: | 14 content::TestBrowserThreadBundle thread_bundle_; |
| 18 CannedBrowsingDataDatabaseHelperTest() | |
| 19 : ui_thread_(BrowserThread::UI, &message_loop_) { | |
| 20 } | |
| 21 | |
| 22 protected: | |
| 23 base::MessageLoop message_loop_; | |
| 24 content::TestBrowserThread ui_thread_; | |
| 25 }; | 15 }; |
| 26 | 16 |
| 27 TEST_F(CannedBrowsingDataDatabaseHelperTest, Empty) { | 17 TEST_F(CannedBrowsingDataDatabaseHelperTest, Empty) { |
| 28 TestingProfile profile; | 18 TestingProfile profile; |
| 29 | 19 |
| 30 const GURL origin("http://host1:1/"); | 20 const GURL origin("http://host1:1/"); |
| 31 const char db[] = "db1"; | 21 const char db[] = "db1"; |
| 32 | 22 |
| 33 scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( | 23 scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( |
| 34 new CannedBrowsingDataDatabaseHelper(&profile)); | 24 new CannedBrowsingDataDatabaseHelper(&profile)); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 53 ASSERT_TRUE(helper->empty()); | 43 ASSERT_TRUE(helper->empty()); |
| 54 helper->AddDatabase(origin1, db, std::string()); | 44 helper->AddDatabase(origin1, db, std::string()); |
| 55 ASSERT_TRUE(helper->empty()); | 45 ASSERT_TRUE(helper->empty()); |
| 56 helper->AddDatabase(origin2, db, std::string()); | 46 helper->AddDatabase(origin2, db, std::string()); |
| 57 ASSERT_TRUE(helper->empty()); | 47 ASSERT_TRUE(helper->empty()); |
| 58 helper->Reset(); | 48 helper->Reset(); |
| 59 ASSERT_TRUE(helper->empty()); | 49 ASSERT_TRUE(helper->empty()); |
| 60 } | 50 } |
| 61 | 51 |
| 62 } // namespace | 52 } // namespace |
| OLD | NEW |