OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authos. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authos. 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "webkit/appcache/appcache.h" | 6 #include "webkit/appcache/appcache.h" |
7 #include "webkit/appcache/appcache_group.h" | 7 #include "webkit/appcache/appcache_group.h" |
8 #include "webkit/appcache/appcache_service.h" | 8 #include "webkit/appcache/appcache_service.h" |
9 | 9 |
10 using appcache::AppCache; | 10 namespace appcache { |
11 using appcache::AppCacheGroup; | |
12 using appcache::AppCacheService; | |
13 | |
14 namespace { | |
15 | 11 |
16 class AppCacheServiceTest : public testing::Test { | 12 class AppCacheServiceTest : public testing::Test { |
17 }; | 13 }; |
18 | 14 |
19 } // namespace | |
20 | |
21 TEST(AppCacheServiceTest, AddRemoveCache) { | 15 TEST(AppCacheServiceTest, AddRemoveCache) { |
22 AppCacheService service; | 16 AppCacheService service; |
23 scoped_refptr<AppCache> cache = new AppCache(&service, 111); | 17 scoped_refptr<AppCache> cache = new AppCache(&service, 111); |
24 service.RemoveCache(cache); | 18 service.RemoveCache(cache); |
25 | 19 |
26 // Removing non-existing cache from service should not fail. | 20 // Removing non-existing cache from service should not fail. |
27 AppCacheService dummy; | 21 AppCacheService dummy; |
28 dummy.RemoveCache(cache); | 22 dummy.RemoveCache(cache); |
29 } | 23 } |
30 | 24 |
31 TEST(AppCacheServiceTest, AddRemoveGroup) { | 25 TEST(AppCacheServiceTest, AddRemoveGroup) { |
32 AppCacheService service; | 26 AppCacheService service; |
33 scoped_refptr<AppCacheGroup> group = | 27 scoped_refptr<AppCacheGroup> group = |
34 new AppCacheGroup(&service, GURL::EmptyGURL()); | 28 new AppCacheGroup(&service, GURL::EmptyGURL()); |
35 service.RemoveGroup(group); | 29 service.RemoveGroup(group); |
36 | 30 |
37 // Removing non-existing group from service should not fail. | 31 // Removing non-existing group from service should not fail. |
38 AppCacheService dummy; | 32 AppCacheService dummy; |
39 dummy.RemoveGroup(group); | 33 dummy.RemoveGroup(group); |
40 } | 34 } |
| 35 |
| 36 } // namespace appcache |
OLD | NEW |