OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stack> | 5 #include <stack> |
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/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 | 1405 |
1406 void Verify_FindMainResponseWithMultipleHits() { | 1406 void Verify_FindMainResponseWithMultipleHits() { |
1407 EXPECT_EQ(kEntryUrl, delegate()->found_url_); | 1407 EXPECT_EQ(kEntryUrl, delegate()->found_url_); |
1408 EXPECT_EQ(kManifestUrl3, delegate()->found_manifest_url_); | 1408 EXPECT_EQ(kManifestUrl3, delegate()->found_manifest_url_); |
1409 EXPECT_EQ(3, delegate()->found_cache_id_); | 1409 EXPECT_EQ(3, delegate()->found_cache_id_); |
1410 EXPECT_EQ(3, delegate()->found_group_id_); | 1410 EXPECT_EQ(3, delegate()->found_group_id_); |
1411 EXPECT_EQ(3, delegate()->found_entry_.response_id()); | 1411 EXPECT_EQ(3, delegate()->found_entry_.response_id()); |
1412 EXPECT_TRUE(delegate()->found_entry_.IsExplicit()); | 1412 EXPECT_TRUE(delegate()->found_entry_.IsExplicit()); |
1413 EXPECT_FALSE(delegate()->found_fallback_entry_.has_response_id()); | 1413 EXPECT_FALSE(delegate()->found_fallback_entry_.has_response_id()); |
1414 | 1414 |
1415 // Conduct another test perferring kManifestUrl | 1415 // Conduct another test preferring kManifestUrl |
1416 delegate_.reset(new MockStorageDelegate(this)); | 1416 delegate_.reset(new MockStorageDelegate(this)); |
1417 PushNextTask(base::Bind( | 1417 PushNextTask(base::Bind( |
1418 &AppCacheStorageImplTest::Verify_FindMainResponseWithMultipleHits2, | 1418 &AppCacheStorageImplTest::Verify_FindMainResponseWithMultipleHits2, |
1419 base::Unretained(this))); | 1419 base::Unretained(this))); |
1420 storage()->FindResponseForMainRequest(kEntryUrl, kManifestUrl, delegate()); | 1420 storage()->FindResponseForMainRequest(kEntryUrl, kManifestUrl, delegate()); |
1421 EXPECT_NE(kEntryUrl, delegate()->found_url_); | 1421 EXPECT_NE(kEntryUrl, delegate()->found_url_); |
1422 } | 1422 } |
1423 | 1423 |
1424 void Verify_FindMainResponseWithMultipleHits2() { | 1424 void Verify_FindMainResponseWithMultipleHits2() { |
1425 EXPECT_EQ(kEntryUrl, delegate()->found_url_); | 1425 EXPECT_EQ(kEntryUrl, delegate()->found_url_); |
1426 EXPECT_EQ(kManifestUrl, delegate()->found_manifest_url_); | 1426 EXPECT_EQ(kManifestUrl, delegate()->found_manifest_url_); |
1427 EXPECT_EQ(1, delegate()->found_cache_id_); | 1427 EXPECT_EQ(1, delegate()->found_cache_id_); |
1428 EXPECT_EQ(1, delegate()->found_group_id_); | 1428 EXPECT_EQ(1, delegate()->found_group_id_); |
1429 EXPECT_EQ(1, delegate()->found_entry_.response_id()); | 1429 EXPECT_EQ(1, delegate()->found_entry_.response_id()); |
1430 EXPECT_TRUE(delegate()->found_entry_.IsExplicit()); | 1430 EXPECT_TRUE(delegate()->found_entry_.IsExplicit()); |
1431 EXPECT_FALSE(delegate()->found_fallback_entry_.has_response_id()); | 1431 EXPECT_FALSE(delegate()->found_fallback_entry_.has_response_id()); |
1432 | 1432 |
1433 // Conduct the another test perferring kManifestUrl2 | 1433 // Conduct the another test preferring kManifestUrl2 |
1434 delegate_.reset(new MockStorageDelegate(this)); | 1434 delegate_.reset(new MockStorageDelegate(this)); |
1435 PushNextTask(base::Bind( | 1435 PushNextTask(base::Bind( |
1436 &AppCacheStorageImplTest::Verify_FindMainResponseWithMultipleHits3, | 1436 &AppCacheStorageImplTest::Verify_FindMainResponseWithMultipleHits3, |
1437 base::Unretained(this))); | 1437 base::Unretained(this))); |
1438 storage()->FindResponseForMainRequest(kEntryUrl, kManifestUrl2, delegate()); | 1438 storage()->FindResponseForMainRequest(kEntryUrl, kManifestUrl2, delegate()); |
1439 EXPECT_NE(kEntryUrl, delegate()->found_url_); | 1439 EXPECT_NE(kEntryUrl, delegate()->found_url_); |
1440 } | 1440 } |
1441 | 1441 |
1442 void Verify_FindMainResponseWithMultipleHits3() { | 1442 void Verify_FindMainResponseWithMultipleHits3() { |
1443 EXPECT_EQ(kEntryUrl, delegate()->found_url_); | 1443 EXPECT_EQ(kEntryUrl, delegate()->found_url_); |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); | 2018 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize2); |
2019 } | 2019 } |
2020 | 2020 |
2021 TEST_F(AppCacheStorageImplTest, Reinitialize3) { | 2021 TEST_F(AppCacheStorageImplTest, Reinitialize3) { |
2022 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); | 2022 RunTestOnIOThread(&AppCacheStorageImplTest::Reinitialize3); |
2023 } | 2023 } |
2024 | 2024 |
2025 // That's all folks! | 2025 // That's all folks! |
2026 | 2026 |
2027 } // namespace content | 2027 } // namespace content |
OLD | NEW |