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

Unified Diff: webkit/appcache/appcache_test_helper.h

Issue 7210006: AppCaches which belong to hosted apps are not protected from deletion (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Moving test helpers to webkit/appcache. Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/appcache/appcache_storage_impl.cc ('k') | webkit/appcache/appcache_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/appcache_test_helper.h
diff --git a/webkit/appcache/appcache_test_helper.h b/webkit/appcache/appcache_test_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ca944f061e5bda6e6457a214c5422e588e79518
--- /dev/null
+++ b/webkit/appcache/appcache_test_helper.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_APPCACHE_APPCACHE_TEST_HELPER_H_
+#define WEBKIT_APPCACHE_APPCACHE_TEST_HELPER_H_
+#pragma once
+
+#include <set>
+
+#include "net/base/completion_callback.h"
+#include "webkit/appcache/appcache_storage.h"
+
+namespace appcache {
+
+class AppCacheService;
+
+// Helper class for inserting data into a ChromeAppCacheService and reading it
+// back.
+class AppCacheTestHelper : public appcache::AppCacheStorage::Delegate {
+ public:
+ AppCacheTestHelper();
+ virtual ~AppCacheTestHelper();
+ void AddGroupAndCache(AppCacheService* appcache_service,
+ const GURL& manifest_url);
+
+ void GetOriginsWithCaches(AppCacheService* appcache_service,
+ std::set<GURL>* origins);
+ private:
+ virtual void OnGroupAndNewestCacheStored(
+ appcache::AppCacheGroup* group,
+ appcache::AppCache* newest_cache,
+ bool success,
+ bool would_exceed_quota);
+ void OnGotAppCacheInfo(int rv);
+
+ int group_id_;
+ int appcache_id_;
+ int response_id_;
+ net::CompletionCallbackImpl<AppCacheTestHelper> appcache_got_info_callback_;
+ scoped_refptr<appcache::AppCacheInfoCollection> appcache_info_;
+ std::set<GURL>* origins_; // not owned
+
+ DISALLOW_COPY_AND_ASSIGN(AppCacheTestHelper);
+};
+
+} // namespace appcache
+
+#endif // WEBKIT_APPCACHE_APPCACHE_TEST_HELPER_H_
« no previous file with comments | « webkit/appcache/appcache_storage_impl.cc ('k') | webkit/appcache/appcache_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698