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

Side by Side Diff: webkit/appcache/appcache_service_unittest.cc

Issue 10540042: Move remaining webkit storage unit tests to content_unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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) 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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return pickle->size(); 168 return pickle->size();
169 } 169 }
170 170
171 const GURL kOrigin; 171 const GURL kOrigin;
172 const GURL kManifestUrl; 172 const GURL kManifestUrl;
173 173
174 scoped_ptr<AppCacheService> service_; 174 scoped_ptr<AppCacheService> service_;
175 int delete_result_; 175 int delete_result_;
176 int delete_completion_count_; 176 int delete_completion_count_;
177 net::CompletionCallback deletion_callback_; 177 net::CompletionCallback deletion_callback_;
178
179 private:
180 MessageLoop message_loop_;
178 }; 181 };
179 182
180 TEST_F(AppCacheServiceTest, DeleteAppCachesForOrigin) { 183 TEST_F(AppCacheServiceTest, DeleteAppCachesForOrigin) {
181 // Without giving mock storage simiulated info, should fail. 184 // Without giving mock storage simiulated info, should fail.
182 service_->DeleteAppCachesForOrigin(kOrigin, deletion_callback_); 185 service_->DeleteAppCachesForOrigin(kOrigin, deletion_callback_);
183 EXPECT_EQ(0, delete_completion_count_); 186 EXPECT_EQ(0, delete_completion_count_);
184 MessageLoop::current()->RunAllPending(); 187 MessageLoop::current()->RunAllPending();
185 EXPECT_EQ(1, delete_completion_count_); 188 EXPECT_EQ(1, delete_completion_count_);
186 EXPECT_EQ(net::ERR_FAILED, delete_result_); 189 EXPECT_EQ(net::ERR_FAILED, delete_result_);
187 delete_completion_count_ = 0; 190 delete_completion_count_ = 0;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 MessageLoop::current()->RunAllPending(); 311 MessageLoop::current()->RunAllPending();
309 EXPECT_EQ(0, CountPendingHelpers()); 312 EXPECT_EQ(0, CountPendingHelpers());
310 EXPECT_FALSE(IsGroupStored(kManifestUrl)); 313 EXPECT_FALSE(IsGroupStored(kManifestUrl));
311 ResetStorage(); 314 ResetStorage();
312 315
313 service_.reset(); // Clean up. 316 service_.reset(); // Clean up.
314 MessageLoop::current()->RunAllPending(); 317 MessageLoop::current()->RunAllPending();
315 } 318 }
316 319
317 } // namespace appcache 320 } // namespace appcache
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_quota_client_unittest.cc ('k') | webkit/appcache/mock_appcache_storage_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698