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

Side by Side Diff: Source/web/tests/AssociatedURLLoaderTest.cpp

Issue 643733003: DocumentThreadableLoader: Call clearResource() when rejecting redirect (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years 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 | « Source/core/loader/DocumentThreadableLoader.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 m_expectedResponse.setMIMEType("text/html"); 505 m_expectedResponse.setMIMEType("text/html");
506 m_expectedResponse.setHTTPStatusCode(200); 506 m_expectedResponse.setHTTPStatusCode(200);
507 Platform::current()->unitTestSupport()->registerMockedURL(redirectURL, m_exp ectedResponse, m_frameFilePath); 507 Platform::current()->unitTestSupport()->registerMockedURL(redirectURL, m_exp ectedResponse, m_frameFilePath);
508 508
509 m_expectedLoader = createAssociatedURLLoader(); 509 m_expectedLoader = createAssociatedURLLoader();
510 EXPECT_TRUE(m_expectedLoader); 510 EXPECT_TRUE(m_expectedLoader);
511 m_expectedLoader->loadAsynchronously(request, this); 511 m_expectedLoader->loadAsynchronously(request, this);
512 512
513 serveRequests(); 513 serveRequests();
514 EXPECT_FALSE(m_willSendRequest); 514 EXPECT_FALSE(m_willSendRequest);
515 EXPECT_TRUE(m_didReceiveResponse); 515 EXPECT_FALSE(m_didReceiveResponse);
516 EXPECT_TRUE(m_didReceiveData); 516 EXPECT_FALSE(m_didReceiveData);
517 EXPECT_TRUE(m_didFinishLoading); 517 EXPECT_FALSE(m_didFinishLoading);
518 } 518 }
519 519
520 // Test that a cross origin redirect response without CORS headers fails. 520 // Test that a cross origin redirect response without CORS headers fails.
521 TEST_F(AssociatedURLLoaderTest, RedirectCrossOriginWithAccessControlFailure) 521 TEST_F(AssociatedURLLoaderTest, RedirectCrossOriginWithAccessControlFailure)
522 { 522 {
523 KURL url = toKURL("http://www.test.com/RedirectCrossOriginWithAccessControlF ailure.html"); 523 KURL url = toKURL("http://www.test.com/RedirectCrossOriginWithAccessControlF ailure.html");
524 char redirect[] = "http://www.other.com/RedirectCrossOriginWithAccessControl Failure.html"; // Cross-origin 524 char redirect[] = "http://www.other.com/RedirectCrossOriginWithAccessControl Failure.html"; // Cross-origin
525 KURL redirectURL = toKURL(redirect); 525 KURL redirectURL = toKURL(redirect);
526 526
527 WebURLRequest request; 527 WebURLRequest request;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 m_expectedLoader->loadAsynchronously(request, this); 709 m_expectedLoader->loadAsynchronously(request, this);
710 serveRequests(); 710 serveRequests();
711 EXPECT_TRUE(m_didReceiveResponse); 711 EXPECT_TRUE(m_didReceiveResponse);
712 EXPECT_TRUE(m_didReceiveData); 712 EXPECT_TRUE(m_didReceiveData);
713 EXPECT_TRUE(m_didFinishLoading); 713 EXPECT_TRUE(m_didFinishLoading);
714 714
715 EXPECT_FALSE(m_actualResponse.httpHeaderField(headerNameString).isEmpty()); 715 EXPECT_FALSE(m_actualResponse.httpHeaderField(headerNameString).isEmpty());
716 } 716 }
717 717
718 } 718 }
OLDNEW
« no previous file with comments | « Source/core/loader/DocumentThreadableLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698