Skip to content

Commit

Permalink
Move all remaining appcache unittests from webkit/ to content/
Browse files Browse the repository at this point in the history
BUG=338338
TBR=darin@chromium.org

Review URL: https://codereview.chromium.org/235763002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263477 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pilgrim@chromium.org committed Apr 12, 2014
1 parent 87d95a6 commit a507b82
Show file tree
Hide file tree
Showing 24 changed files with 291 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -17,13 +17,19 @@
#include "webkit/browser/appcache/appcache_database.h"
#include "webkit/browser/appcache/appcache_entry.h"

using appcache::AppCacheDatabase;
using appcache::AppCacheEntry;
using appcache::FALLBACK_NAMESPACE;
using appcache::INTERCEPT_NAMESPACE;
using appcache::NETWORK_NAMESPACE;

namespace {

const base::Time kZeroTime;

} // namespace

namespace appcache {
namespace content {

class AppCacheDatabaseTest {};

Expand Down Expand Up @@ -1207,4 +1213,4 @@ TEST(AppCacheDatabaseTest, UpgradeSchema4to5) {
}
#endif // !APPCACHE_USE_SIMPLE_CACHE

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/browser/appcache/appcache_disk_cache.h"

namespace appcache {
using appcache::AppCacheDiskCache;

namespace content {

class AppCacheDiskCacheTest : public testing::Test {
public:
Expand Down Expand Up @@ -183,4 +185,4 @@ TEST_F(AppCacheDiskCacheTest, DISABLED_DisableWithEntriesOpen) {
FlushCacheTasks();
}

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -13,6 +13,14 @@
#include "webkit/browser/appcache/mock_appcache_service.h"
#include "webkit/common/appcache/appcache_interfaces.h"

using appcache::AppCache;
using appcache::AppCacheFrontend;
using appcache::AppCacheGroup;
using appcache::AppCacheHost;
using appcache::AppCacheService;
using appcache::AppCacheUpdateJob;
using appcache::MockAppCacheService;

namespace {

class TestAppCacheFrontend : public appcache::AppCacheFrontend {
Expand Down Expand Up @@ -61,7 +69,7 @@ class TestAppCacheFrontend : public appcache::AppCacheFrontend {

} // namespace anon

namespace appcache {
namespace content {

class TestUpdateObserver : public AppCacheGroup::UpdateObserver {
public:
Expand Down Expand Up @@ -299,4 +307,4 @@ TEST_F(AppCacheGroupTest, QueueUpdate) {
EXPECT_TRUE(host.update_completed_);
}

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -13,7 +13,10 @@
#include "webkit/browser/appcache/appcache_quota_client.h"
#include "webkit/browser/appcache/mock_appcache_service.h"

namespace appcache {
using appcache::AppCacheQuotaClient;
using appcache::MockAppCacheService;

namespace content {

// Declared to shorten the line lengths.
static const quota::StorageType kTemp = quota::kStorageTypeTemporary;
Expand Down Expand Up @@ -432,4 +435,4 @@ TEST_F(AppCacheQuotaClientTest, DestroyWithDeleteInProgress) {
Call_OnQuotaManagerDestroyed(client);
}

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -20,10 +20,16 @@
#include "webkit/browser/appcache/appcache_response.h"
#include "webkit/browser/appcache/mock_appcache_service.h"

using appcache::AppCacheStorage;
using appcache::AppCacheResponseInfo;
using appcache::AppCacheResponseReader;
using appcache::AppCacheResponseWriter;
using appcache::HttpResponseInfoIOBuffer;
using appcache::MockAppCacheService;
using net::IOBuffer;
using net::WrappedIOBuffer;

namespace appcache {
namespace content {

static const int kNumBlocks = 4;
static const int kBlockSize = 1024;
Expand Down Expand Up @@ -714,4 +720,4 @@ TEST_F(AppCacheResponseTest, DeleteWithIOPending) {
RunTestOnIOThread(&AppCacheResponseTest::DeleteWithIOPending);
}

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -16,8 +16,18 @@
#include "webkit/browser/appcache/appcache_service.h"
#include "webkit/browser/appcache/mock_appcache_storage.h"


namespace appcache {
using appcache::AppCache;
using appcache::AppCacheEntry;
using appcache::AppCacheGroup;
using appcache::AppCacheInfo;
using appcache::AppCacheInfoCollection;
using appcache::AppCacheInfoVector;
using appcache::AppCacheResponseReader;
using appcache::AppCacheService;
using appcache::HttpResponseInfoIOBuffer;
using appcache::MockAppCacheStorage;

namespace content {
namespace {

const int64 kMockGroupId = 1;
Expand Down Expand Up @@ -374,4 +384,4 @@ TEST_F(AppCacheServiceTest, ScheduleReinitialize) {



} // namespace appcache
} // namespace content
2 changes: 1 addition & 1 deletion content/browser/appcache/appcache_storage_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2031,4 +2031,4 @@ TEST_F(AppCacheStorageImplTest, Reinitialize3) {

// That's all folks!

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -7,7 +7,26 @@
#include "webkit/browser/appcache/appcache_host.h"
#include "webkit/browser/appcache/mock_appcache_service.h"

namespace appcache {
using appcache::AppCache;
using appcache::AppCacheDatabase;
using appcache::AppCacheEntry;
using appcache::AppCacheFrontend;
using appcache::AppCacheGroup;
using appcache::AppCacheHost;
using appcache::AppCacheInfo;
using appcache::ErrorDetails;
using appcache::EventID;
using appcache::FALLBACK_NAMESPACE;
using appcache::INTERCEPT_NAMESPACE;
using appcache::LogLevel;
using appcache::Manifest;
using appcache::MockAppCacheService;
using appcache::Namespace;
using appcache::NamespaceVector;
using appcache::NETWORK_NAMESPACE;
using appcache::Status;

namespace content {

namespace {

Expand Down Expand Up @@ -692,4 +711,4 @@ TEST(AppCacheTest, IsNamespaceMatch) {
"/and_even_more_for_the_heck_of_it/01234567890abcdef/b")));
}

} // namespace appacache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -20,7 +20,34 @@
#include "webkit/browser/appcache/appcache_update_job.h"
#include "webkit/browser/appcache/mock_appcache_service.h"

namespace appcache {
using appcache::AppCache;
using appcache::AppCacheEntry;
using appcache::AppCacheFrontend;
using appcache::AppCacheHost;
using appcache::AppCacheGroup;
using appcache::AppCacheResponseInfo;
using appcache::AppCacheUpdateJob;
using appcache::AppCacheResponseWriter;
using appcache::CACHED_EVENT;
using appcache::CHECKING_EVENT;
using appcache::DOWNLOADING_EVENT;
using appcache::ERROR_EVENT;
using appcache::EventID;
using appcache::FALLBACK_NAMESPACE;
using appcache::HttpResponseInfoIOBuffer;
using appcache::kNoCacheId;
using appcache::kNoResponseId;
using appcache::MockAppCacheService;
using appcache::MockAppCacheStorage;
using appcache::Namespace;
using appcache::NETWORK_NAMESPACE;
using appcache::NO_UPDATE_EVENT;
using appcache::OBSOLETE_EVENT;
using appcache::PROGRESS_EVENT;
using appcache::UPDATE_READY_EVENT;
using appcache::Status;

namespace content {
class AppCacheUpdateJobTest;

namespace {
Expand Down Expand Up @@ -3690,4 +3717,4 @@ TEST_F(AppCacheUpdateJobTest, CrossOriginHttpsDenied) {
RunTestOnIOThread(&AppCacheUpdateJobTest::CrossOriginHttpsDeniedTest);
}

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -24,10 +24,19 @@
#include "webkit/browser/appcache/appcache_url_request_job.h"
#include "webkit/browser/appcache/mock_appcache_service.h"

using appcache::AppCacheEntry;
using appcache::AppCacheStorage;
using appcache::AppCacheResponseInfo;
using appcache::AppCacheResponseReader;
using appcache::AppCacheResponseWriter;
using appcache::AppCacheURLRequestJob;
using appcache::HttpResponseInfoIOBuffer;
using appcache::kNoCacheId;
using appcache::MockAppCacheService;
using net::IOBuffer;
using net::WrappedIOBuffer;

namespace appcache {
namespace content {

static const char kHttpBasicHeaders[] =
"HTTP/1.0 200 OK\0Content-Length: 5\0\0";
Expand Down Expand Up @@ -817,4 +826,4 @@ TEST_F(AppCacheURLRequestJobTest, CancelRequestWithIOPending) {
RunTestOnIOThread(&AppCacheURLRequestJobTest::CancelRequestWithIOPending);
}

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -8,7 +8,13 @@
#include "url/gurl.h"
#include "webkit/browser/appcache/manifest_parser.h"

namespace appcache {
using appcache::Manifest;
using appcache::NamespaceVector;
using appcache::FALLBACK_NAMESPACE;
using appcache::INTERCEPT_NAMESPACE;
using appcache::NETWORK_NAMESPACE;

namespace content {

class AppCacheManifestParserTest : public testing::Test {
};
Expand Down Expand Up @@ -469,4 +475,4 @@ TEST(AppCacheManifestParserTest, PatternMatching) {
manifest.online_whitelist_namespaces[1].target_url);
}

} // namespace appcache
} // namespace content
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 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.

Expand All @@ -10,7 +10,21 @@
#include "webkit/browser/appcache/appcache_storage.h"
#include "webkit/browser/appcache/mock_appcache_service.h"

namespace appcache {
using appcache::AppCache;
using appcache::AppCacheEntry;
using appcache::AppCacheGroup;
using appcache::AppCacheStorage;
using appcache::FALLBACK_NAMESPACE;
using appcache::INTERCEPT_NAMESPACE;
using appcache::kNoCacheId;
using appcache::kNoResponseId;
using appcache::Manifest;
using appcache::MockAppCacheService;
using appcache::MockAppCacheStorage;
using appcache::Namespace;
using appcache::NETWORK_NAMESPACE;

namespace content {

class MockAppCacheStorageTest : public testing::Test {
public:
Expand Down Expand Up @@ -628,4 +642,4 @@ TEST_F(MockAppCacheStorageTest, FindMainResponseExclusions) {
EXPECT_EQ(0, delegate.found_fallback_entry_.types());
}

} // namespace appcache
} // namespace content
Loading

0 comments on commit a507b82

Please sign in to comment.