| OLD | NEW |
| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 | 420 |
| 421 MockResource* fetched = fetchMockResource(); | 421 MockResource* fetched = fetchMockResource(); |
| 422 EXPECT_NE(firstResource, fetched); | 422 EXPECT_NE(firstResource, fetched); |
| 423 } | 423 } |
| 424 | 424 |
| 425 TEST_F(MemoryCacheCorrectnessTest, PostToSameURLTwice) { | 425 TEST_F(MemoryCacheCorrectnessTest, PostToSameURLTwice) { |
| 426 ResourceRequest request1(KURL(ParsedURLString, kResourceURL)); | 426 ResourceRequest request1(KURL(ParsedURLString, kResourceURL)); |
| 427 request1.setHTTPMethod(HTTPNames::POST); | 427 request1.setHTTPMethod(HTTPNames::POST); |
| 428 RawResource* resource1 = | 428 RawResource* resource1 = |
| 429 RawResource::create(ResourceRequest(request1.url()), Resource::Raw); | 429 RawResource::create(ResourceRequest(request1.url()), Resource::Raw); |
| 430 resource1->setStatus(Resource::Pending); | 430 resource1->setStatus(ResourceStatus::Pending); |
| 431 memoryCache()->add(resource1); | 431 memoryCache()->add(resource1); |
| 432 | 432 |
| 433 ResourceRequest request2(KURL(ParsedURLString, kResourceURL)); | 433 ResourceRequest request2(KURL(ParsedURLString, kResourceURL)); |
| 434 request2.setHTTPMethod(HTTPNames::POST); | 434 request2.setHTTPMethod(HTTPNames::POST); |
| 435 FetchRequest fetch2(request2, FetchInitiatorInfo()); | 435 FetchRequest fetch2(request2, FetchInitiatorInfo()); |
| 436 RawResource* resource2 = RawResource::fetchSynchronously(fetch2, fetcher()); | 436 RawResource* resource2 = RawResource::fetchSynchronously(fetch2, fetcher()); |
| 437 | 437 |
| 438 EXPECT_EQ(resource2, memoryCache()->resourceForURL(request2.url())); | 438 EXPECT_EQ(resource2, memoryCache()->resourceForURL(request2.url())); |
| 439 EXPECT_NE(resource1, resource2); | 439 EXPECT_NE(resource1, resource2); |
| 440 } | 440 } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 firstResource->finish(); | 555 firstResource->finish(); |
| 556 memoryCache()->add(firstResource); | 556 memoryCache()->add(firstResource); |
| 557 | 557 |
| 558 advanceClock(500.); | 558 advanceClock(500.); |
| 559 | 559 |
| 560 MockResource* fetched = fetchMockResource(); | 560 MockResource* fetched = fetchMockResource(); |
| 561 EXPECT_EQ(firstResource, fetched); | 561 EXPECT_EQ(firstResource, fetched); |
| 562 } | 562 } |
| 563 | 563 |
| 564 } // namespace blink | 564 } // namespace blink |
| OLD | NEW |