| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 class TestReloadDoesntRedirectWebFrameClient : public WebFrameClient { | 1088 class TestReloadDoesntRedirectWebFrameClient : public WebFrameClient { |
| 1089 public: | 1089 public: |
| 1090 virtual WebNavigationPolicy decidePolicyForNavigation( | 1090 virtual WebNavigationPolicy decidePolicyForNavigation( |
| 1091 WebFrame*, const WebURLRequest&, WebNavigationType, | 1091 WebFrame*, const WebURLRequest&, WebNavigationType, |
| 1092 const WebNode& originatingNode, | 1092 const WebNode& originatingNode, |
| 1093 WebNavigationPolicy defaultPolicy, bool isRedirect) | 1093 WebNavigationPolicy defaultPolicy, bool isRedirect) |
| 1094 { | 1094 { |
| 1095 EXPECT_FALSE(isRedirect); | 1095 EXPECT_FALSE(isRedirect); |
| 1096 return WebNavigationPolicyCurrentTab; | 1096 return WebNavigationPolicyCurrentTab; |
| 1097 } | 1097 } |
| 1098 | |
| 1099 virtual WebURLError cancelledError(WebFrame*, const WebURLRequest& request) | |
| 1100 { | |
| 1101 // Return a dummy error so the DocumentLoader doesn't assert when | |
| 1102 // the reload cancels it. | |
| 1103 WebURLError webURLError; | |
| 1104 webURLError.domain = ""; | |
| 1105 webURLError.reason = 1; | |
| 1106 webURLError.isCancellation = true; | |
| 1107 webURLError.unreachableURL = WebURL(); | |
| 1108 return webURLError; | |
| 1109 } | |
| 1110 }; | 1098 }; |
| 1111 | 1099 |
| 1112 TEST_F(WebFrameTest, ReloadDoesntSetRedirect) | 1100 TEST_F(WebFrameTest, ReloadDoesntSetRedirect) |
| 1113 { | 1101 { |
| 1114 // Test for case in http://crbug.com/73104. Reloading a frame very quickly | 1102 // Test for case in http://crbug.com/73104. Reloading a frame very quickly |
| 1115 // would sometimes call decidePolicyForNavigation with isRedirect=true | 1103 // would sometimes call decidePolicyForNavigation with isRedirect=true |
| 1116 registerMockedHttpURLLoad("form.html"); | 1104 registerMockedHttpURLLoad("form.html"); |
| 1117 | 1105 |
| 1118 TestReloadDoesntRedirectWebFrameClient webFrameClient; | 1106 TestReloadDoesntRedirectWebFrameClient webFrameClient; |
| 1119 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "form.html",
false, &webFrameClient); | 1107 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "form.html",
false, &webFrameClient); |
| (...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 EXPECT_FALSE(client.wasProgrammaticScroll()); | 2646 EXPECT_FALSE(client.wasProgrammaticScroll()); |
| 2659 EXPECT_TRUE(client.wasUserScroll()); | 2647 EXPECT_TRUE(client.wasUserScroll()); |
| 2660 client.reset(); | 2648 client.reset(); |
| 2661 | 2649 |
| 2662 m_webView->close(); | 2650 m_webView->close(); |
| 2663 m_webView = 0; | 2651 m_webView = 0; |
| 2664 } | 2652 } |
| 2665 | 2653 |
| 2666 | 2654 |
| 2667 } // namespace | 2655 } // namespace |
| OLD | NEW |