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

Side by Side Diff: content/browser/appcache/appcache_unittest.cc

Issue 276093003: appcache content-type check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 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 "content/browser/appcache/mock_appcache_service.h" 5 #include "content/browser/appcache/mock_appcache_service.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "webkit/browser/appcache/appcache.h" 7 #include "webkit/browser/appcache/appcache.h"
8 #include "webkit/browser/appcache/appcache_host.h" 8 #include "webkit/browser/appcache/appcache_host.h"
9 9
10 using appcache::AppCache; 10 using appcache::AppCache;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 "FALLBACK:\r" 570 "FALLBACK:\r"
571 "/ /fallback.html\r" 571 "/ /fallback.html\r"
572 "NETWORK:\r" 572 "NETWORK:\r"
573 "/whitelist* isPattern\r" 573 "/whitelist* isPattern\r"
574 "*\r"); 574 "*\r");
575 MockAppCacheService service; 575 MockAppCacheService service;
576 scoped_refptr<AppCacheGroup> group = 576 scoped_refptr<AppCacheGroup> group =
577 new AppCacheGroup(service.storage(), kManifestUrl, kGroupId); 577 new AppCacheGroup(service.storage(), kManifestUrl, kGroupId);
578 scoped_refptr<AppCache> cache(new AppCache(service.storage(), kCacheId)); 578 scoped_refptr<AppCache> cache(new AppCache(service.storage(), kCacheId));
579 Manifest manifest; 579 Manifest manifest;
580 EXPECT_TRUE( 580 EXPECT_TRUE(ParseManifest(kManifestUrl, kData.c_str(), kData.length(),
581 ParseManifest(kManifestUrl, kData.c_str(), kData.length(), manifest)); 581 true, manifest));
582 cache->InitializeWithManifest(&manifest); 582 cache->InitializeWithManifest(&manifest);
583 EXPECT_EQ(NETWORK_NAMESPACE, cache->online_whitelist_namespaces_[0].type); 583 EXPECT_EQ(NETWORK_NAMESPACE, cache->online_whitelist_namespaces_[0].type);
584 EXPECT_TRUE(cache->online_whitelist_namespaces_[0].is_pattern); 584 EXPECT_TRUE(cache->online_whitelist_namespaces_[0].is_pattern);
585 EXPECT_EQ(kWhitelistUrl, 585 EXPECT_EQ(kWhitelistUrl,
586 cache->online_whitelist_namespaces_[0].namespace_url); 586 cache->online_whitelist_namespaces_[0].namespace_url);
587 cache->AddEntry( 587 cache->AddEntry(
588 kManifestUrl, 588 kManifestUrl,
589 AppCacheEntry(AppCacheEntry::MANIFEST, 1, 1)); 589 AppCacheEntry(AppCacheEntry::MANIFEST, 1, 1));
590 cache->AddEntry( 590 cache->AddEntry(
591 kInterceptUrl, 591 kInterceptUrl,
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 EXPECT_TRUE(star_greediness.IsMatch( 704 EXPECT_TRUE(star_greediness.IsMatch(
705 GURL("http://foo.com/a/b/01234567890abcdef/b"))); 705 GURL("http://foo.com/a/b/01234567890abcdef/b")));
706 EXPECT_TRUE(star_greediness.IsMatch( 706 EXPECT_TRUE(star_greediness.IsMatch(
707 GURL("http://foo.com/a/b/01234567890abcdef/b01234567890abcdef/b"))); 707 GURL("http://foo.com/a/b/01234567890abcdef/b01234567890abcdef/b")));
708 EXPECT_TRUE(star_greediness.IsMatch( 708 EXPECT_TRUE(star_greediness.IsMatch(
709 GURL("http://foo.com/a/b/01234567890abcdef_eat_some_more_characters_" 709 GURL("http://foo.com/a/b/01234567890abcdef_eat_some_more_characters_"
710 "/and_even_more_for_the_heck_of_it/01234567890abcdef/b"))); 710 "/and_even_more_for_the_heck_of_it/01234567890abcdef/b")));
711 } 711 }
712 712
713 } // namespace content 713 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/appcache/manifest_parser_unittest.cc » ('j') | webkit/browser/appcache/appcache_update_job.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698