OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_database_helper.h" | 5 #include "chrome/browser/browsing_data_database_helper.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "chrome/test/base/testing_browser_process_test.h" | |
9 #include "chrome/test/base/testing_profile.h" | 8 #include "chrome/test/base/testing_profile.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
11 | 10 |
12 namespace { | 11 namespace { |
13 | 12 |
14 typedef TestingBrowserProcessTest CannedBrowsingDataDatabaseTest; | 13 typedef testing::Test CannedBrowsingDataDatabaseTest; |
15 | 14 |
16 TEST_F(CannedBrowsingDataDatabaseTest, Empty) { | 15 TEST_F(CannedBrowsingDataDatabaseTest, Empty) { |
17 TestingProfile profile; | 16 TestingProfile profile; |
18 | 17 |
19 const GURL origin("http://host1:1/"); | 18 const GURL origin("http://host1:1/"); |
20 const char db[] = "db1"; | 19 const char db[] = "db1"; |
21 | 20 |
22 scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( | 21 scoped_refptr<CannedBrowsingDataDatabaseHelper> helper( |
23 new CannedBrowsingDataDatabaseHelper(&profile)); | 22 new CannedBrowsingDataDatabaseHelper(&profile)); |
24 | 23 |
25 ASSERT_TRUE(helper->empty()); | 24 ASSERT_TRUE(helper->empty()); |
26 helper->AddDatabase(origin, db, ""); | 25 helper->AddDatabase(origin, db, ""); |
27 ASSERT_FALSE(helper->empty()); | 26 ASSERT_FALSE(helper->empty()); |
28 helper->Reset(); | 27 helper->Reset(); |
29 ASSERT_TRUE(helper->empty()); | 28 ASSERT_TRUE(helper->empty()); |
30 } | 29 } |
31 | 30 |
32 } // namespace | 31 } // namespace |
OLD | NEW |