Commit 0184c376 authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

appcache: move appcache helper class to appcache dir

This is only used by one unit test, so move it out of content/test.

This is a follow-up to:
https://chromium-review.googlesource.com/c/chromium/src/+/2246957

Bug: 1094811
Change-Id: I5ecc0637514dca22055850d59c933c5380537710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2250342
Auto-Submit: enne <enne@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779576}
parent 644da5ca
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/test/appcache_test_helper.h"
#include "content/browser/appcache/appcache_test_helper.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
......@@ -29,26 +29,22 @@ void AppCacheTestHelper::OnGroupAndNewestCacheStored(
base::RunLoop::QuitCurrentWhenIdleDeprecated();
}
void AppCacheTestHelper::AddGroupAndCache(AppCacheServiceImpl*
appcache_service, const GURL& manifest_url) {
void AppCacheTestHelper::AddGroupAndCache(AppCacheServiceImpl* appcache_service,
const GURL& manifest_url) {
AppCacheGroup* appcache_group =
new AppCacheGroup(appcache_service->storage(),
manifest_url,
++group_id_);
AppCache* appcache = new AppCache(
appcache_service->storage(), ++appcache_id_);
new AppCacheGroup(appcache_service->storage(), manifest_url, ++group_id_);
AppCache* appcache =
new AppCache(appcache_service->storage(), ++appcache_id_);
appcache->set_manifest_parser_version(0);
appcache->set_manifest_scope("/");
appcache->set_token_expires(base::Time::Now() +
base::TimeDelta::FromDays(10));
AppCacheEntry entry(AppCacheEntry::MANIFEST,
++response_id_);
AppCacheEntry entry(AppCacheEntry::MANIFEST, ++response_id_);
appcache->AddEntry(manifest_url, entry);
appcache->set_complete(true);
appcache_group->AddCache(appcache);
appcache_service->storage()->StoreGroupAndNewestCache(appcache_group,
appcache,
this);
appcache, this);
// OnGroupAndNewestCacheStored will quit the message loop.
base::RunLoop().Run();
}
......@@ -68,7 +64,6 @@ void AppCacheTestHelper::GetOriginsWithCaches(
}
void AppCacheTestHelper::OnGotAppCacheInfo(int rv) {
origins_->clear();
for (const auto& kvp : appcache_info_->infos_by_origin)
origins_->insert(kvp.first);
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_TEST_APPCACHE_TEST_HELPER_H_
#define CONTENT_TEST_APPCACHE_TEST_HELPER_H_
#ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_TEST_HELPER_H_
#define CONTENT_BROWSER_APPCACHE_APPCACHE_TEST_HELPER_H_
#include <set>
......@@ -46,4 +46,4 @@ class AppCacheTestHelper : public AppCacheStorage::Delegate {
} // namespace content
#endif // CONTENT_TEST_APPCACHE_TEST_HELPER_H_
#endif // CONTENT_BROWSER_APPCACHE_APPCACHE_TEST_HELPER_H_
......@@ -16,12 +16,12 @@
#include "base/threading/thread_task_runner_handle.h"
#include "content/browser/appcache/appcache_database.h"
#include "content/browser/appcache/appcache_storage_impl.h"
#include "content/browser/appcache/appcache_test_helper.h"
#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "content/test/appcache_test_helper.h"
#include "net/url_request/url_request_context_getter.h"
#include "storage/browser/test/mock_special_storage_policy.h"
#include "testing/gtest/include/gtest/gtest.h"
......
......@@ -243,8 +243,6 @@ jumbo_static_library("test_support") {
"../public/test/web_contents_tester.h",
"../public/test/web_ui_browsertest_util.cc",
"../public/test/web_ui_browsertest_util.h",
"appcache_test_helper.cc",
"appcache_test_helper.h",
"content_browser_sanity_checker.cc",
"content_browser_sanity_checker.h",
"content_test_suite.cc",
......@@ -1625,6 +1623,8 @@ test("content_unittests") {
"../browser/appcache/appcache_service_unittest.cc",
"../browser/appcache/appcache_storage_impl_unittest.cc",
"../browser/appcache/appcache_storage_unittest.cc",
"../browser/appcache/appcache_test_helper.cc",
"../browser/appcache/appcache_test_helper.h",
"../browser/appcache/appcache_unittest.cc",
"../browser/appcache/appcache_update_job_unittest.cc",
"../browser/appcache/chrome_appcache_service_unittest.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment