| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/http/http_util.h" | 10 #include "net/http/http_util.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 Start(); | 519 Start(); |
| 520 Redirect(kHttpRedirectToSameDomainUrl1); | 520 Redirect(kHttpRedirectToSameDomainUrl1); |
| 521 Redirect(kHttpRedirectToSameDomainUrl2); | 521 Redirect(kHttpRedirectToSameDomainUrl2); |
| 522 FullResponse(1024); | 522 FullResponse(1024); |
| 523 EXPECT_TRUE(loader_->HasSingleOrigin()); | 523 EXPECT_TRUE(loader_->HasSingleOrigin()); |
| 524 StopWhenLoad(); | 524 StopWhenLoad(); |
| 525 | 525 |
| 526 // Test redirect to a different domain. | 526 // Test redirect to a different domain. |
| 527 Initialize(kHttpUrl, -1, -1); | 527 Initialize(kHttpUrl, -1, -1); |
| 528 Start(); | 528 Start(); |
| 529 EXPECT_CALL(*this, StartCallback(net::ERR_ADDRESS_INVALID)); | |
| 530 Redirect(kHttpRedirectToDifferentDomainUrl1); | 529 Redirect(kHttpRedirectToDifferentDomainUrl1); |
| 531 EXPECT_FALSE(loader_->HasSingleOrigin()); | 530 EXPECT_FALSE(loader_->HasSingleOrigin()); |
| 532 StopWhenLoad(); | 531 StopWhenLoad(); |
| 533 | 532 |
| 534 // Test redirect to the same domain and then to a different domain. | 533 // Test redirect to the same domain and then to a different domain. |
| 535 Initialize(kHttpUrl, -1, -1); | 534 Initialize(kHttpUrl, -1, -1); |
| 536 Start(); | 535 Start(); |
| 537 Redirect(kHttpRedirectToSameDomainUrl1); | 536 Redirect(kHttpRedirectToSameDomainUrl1); |
| 538 EXPECT_CALL(*this, StartCallback(net::ERR_ADDRESS_INVALID)); | |
| 539 Redirect(kHttpRedirectToDifferentDomainUrl1); | 537 Redirect(kHttpRedirectToDifferentDomainUrl1); |
| 540 EXPECT_FALSE(loader_->HasSingleOrigin()); | 538 EXPECT_FALSE(loader_->HasSingleOrigin()); |
| 541 StopWhenLoad(); | 539 StopWhenLoad(); |
| 542 } | 540 } |
| 543 | 541 |
| 544 // TODO(hclam): add unit test for defer loading. | 542 // TODO(hclam): add unit test for defer loading. |
| 545 | 543 |
| 546 } // namespace webkit_glue | 544 } // namespace webkit_glue |
| OLD | NEW |