| 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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 WebURLLoaderOptions options; | 541 WebURLLoaderOptions options; |
| 542 options.crossOriginRequestPolicy = WebURLLoaderOptions::CrossOriginRequestPo
licyUseAccessControl; | 542 options.crossOriginRequestPolicy = WebURLLoaderOptions::CrossOriginRequestPo
licyUseAccessControl; |
| 543 m_expectedLoader = createAssociatedURLLoader(options); | 543 m_expectedLoader = createAssociatedURLLoader(options); |
| 544 EXPECT_TRUE(m_expectedLoader); | 544 EXPECT_TRUE(m_expectedLoader); |
| 545 m_expectedLoader->loadAsynchronously(request, this); | 545 m_expectedLoader->loadAsynchronously(request, this); |
| 546 | 546 |
| 547 serveRequests(); | 547 serveRequests(); |
| 548 // We should get a notification about access control check failure. | 548 // We should get a notification about access control check failure. |
| 549 EXPECT_FALSE(m_willSendRequest); | 549 EXPECT_FALSE(m_willSendRequest); |
| 550 EXPECT_FALSE(m_didReceiveResponse); | 550 EXPECT_FALSE(m_didReceiveResponse); |
| 551 EXPECT_TRUE(m_didReceiveData); | 551 EXPECT_FALSE(m_didReceiveData); |
| 552 EXPECT_TRUE(m_didFail); | 552 EXPECT_TRUE(m_didFail); |
| 553 } | 553 } |
| 554 | 554 |
| 555 // Test that a cross origin redirect response with CORS headers that allow the r
equesting origin succeeds. | 555 // Test that a cross origin redirect response with CORS headers that allow the r
equesting origin succeeds. |
| 556 TEST_F(AssociatedURLLoaderTest, RedirectCrossOriginWithAccessControlSuccess) | 556 TEST_F(AssociatedURLLoaderTest, RedirectCrossOriginWithAccessControlSuccess) |
| 557 { | 557 { |
| 558 KURL url = toKURL("http://www.test.com/RedirectCrossOriginWithAccessControlS
uccess.html"); | 558 KURL url = toKURL("http://www.test.com/RedirectCrossOriginWithAccessControlS
uccess.html"); |
| 559 char redirect[] = "http://www.other.com/RedirectCrossOriginWithAccessControl
Success.html"; // Cross-origin | 559 char redirect[] = "http://www.other.com/RedirectCrossOriginWithAccessControl
Success.html"; // Cross-origin |
| 560 KURL redirectURL = toKURL(redirect); | 560 KURL redirectURL = toKURL(redirect); |
| 561 | 561 |
| (...skipping 147 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 } // namespace blink | 718 } // namespace blink |
| OLD | NEW |