OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |