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