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

Side by Side Diff: Source/core/fetch/CachingCorrectnessTest.cpp

Issue 640463003: MemoryCache: Enable MemoryCache to have multiple isolated resource maps (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remake Created 6 years, 2 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
« no previous file with comments | « no previous file | Source/core/fetch/ImageResourceTest.cpp » ('j') | Source/core/fetch/MemoryCache.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 request1.setHTTPMethod("POST"); 453 request1.setHTTPMethod("POST");
454 ResourcePtr<Resource> resource1 = new Resource(ResourceRequest(request1.url( )), Resource::Raw); 454 ResourcePtr<Resource> resource1 = new Resource(ResourceRequest(request1.url( )), Resource::Raw);
455 resource1->setLoading(true); 455 resource1->setLoading(true);
456 memoryCache()->add(resource1.get()); 456 memoryCache()->add(resource1.get());
457 457
458 ResourceRequest request2(KURL(ParsedURLString, kResourceURL)); 458 ResourceRequest request2(KURL(ParsedURLString, kResourceURL));
459 request2.setHTTPMethod("POST"); 459 request2.setHTTPMethod("POST");
460 FetchRequest fetch2(request2, FetchInitiatorInfo()); 460 FetchRequest fetch2(request2, FetchInitiatorInfo());
461 ResourcePtr<Resource> resource2 = fetcher()->fetchSynchronously(fetch2); 461 ResourcePtr<Resource> resource2 = fetcher()->fetchSynchronously(fetch2);
462 462
463 EXPECT_EQ(resource2, memoryCache()->resourceForURL(request2.url())); 463 EXPECT_EQ(resource2, memoryCache()->resourceForURL(MemoryCache::defaultCache Identifier(), request2.url()));
464 EXPECT_NE(resource1, resource2); 464 EXPECT_NE(resource1, resource2);
465 } 465 }
466 466
467 TEST_F(CachingCorrectnessTest, 302RedirectNotImplicitlyFresh) 467 TEST_F(CachingCorrectnessTest, 302RedirectNotImplicitlyFresh)
468 { 468 {
469 KURL redirectUrl(ParsedURLString, kResourceURL); 469 KURL redirectUrl(ParsedURLString, kResourceURL);
470 const char redirectTargetUrlString[] = "http://redirect-target.com"; 470 const char redirectTargetUrlString[] = "http://redirect-target.com";
471 KURL redirectTargetUrl(ParsedURLString, redirectTargetUrlString); 471 KURL redirectTargetUrl(ParsedURLString, redirectTargetUrlString);
472 472
473 ResourcePtr<Resource> firstResource = new Resource(ResourceRequest(redirectU rl), Resource::Raw); 473 ResourcePtr<Resource> firstResource = new Resource(ResourceRequest(redirectU rl), Resource::Raw);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 firstResource->setResponse(fresh200Response); 563 firstResource->setResponse(fresh200Response);
564 memoryCache()->add(firstResource.get()); 564 memoryCache()->add(firstResource.get());
565 565
566 advanceClock(500.); 566 advanceClock(500.);
567 567
568 ResourcePtr<Resource> fetched = fetch(); 568 ResourcePtr<Resource> fetched = fetch();
569 EXPECT_EQ(firstResource, fetched); 569 EXPECT_EQ(firstResource, fetched);
570 } 570 }
571 571
572 } // namespace 572 } // namespace
OLDNEW
« no previous file with comments | « no previous file | Source/core/fetch/ImageResourceTest.cpp » ('j') | Source/core/fetch/MemoryCache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698