Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 #include "ui/events/test/events_test_utils.h" | 90 #include "ui/events/test/events_test_utils.h" |
| 91 #include "ui/events/test/events_test_utils_x11.h" | 91 #include "ui/events/test/events_test_utils_x11.h" |
| 92 #endif | 92 #endif |
| 93 | 93 |
| 94 #if defined(USE_OZONE) | 94 #if defined(USE_OZONE) |
| 95 #include "ui/events/keycodes/keyboard_code_conversion.h" | 95 #include "ui/events/keycodes/keyboard_code_conversion.h" |
| 96 #endif | 96 #endif |
| 97 | 97 |
| 98 #include "url/url_constants.h" | 98 #include "url/url_constants.h" |
| 99 | 99 |
| 100 using base::TimeDelta; | |
| 100 using blink::WebFrame; | 101 using blink::WebFrame; |
| 101 using blink::WebFrameContentDumper; | 102 using blink::WebFrameContentDumper; |
| 102 using blink::WebInputEvent; | 103 using blink::WebInputEvent; |
| 103 using blink::WebLocalFrame; | 104 using blink::WebLocalFrame; |
| 104 using blink::WebMouseEvent; | 105 using blink::WebMouseEvent; |
| 105 using blink::WebRuntimeFeatures; | 106 using blink::WebRuntimeFeatures; |
| 106 using blink::WebString; | 107 using blink::WebString; |
| 107 using blink::WebTextDirection; | 108 using blink::WebTextDirection; |
| 108 using blink::WebURLError; | 109 using blink::WebURLError; |
| 109 | 110 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 result.unique_name = | 183 result.unique_name = |
| 183 base::UTF16ToUTF8(base::StringPiece16(frame->uniqueName())); | 184 base::UTF16ToUTF8(base::StringPiece16(frame->uniqueName())); |
| 184 result.sandbox_flags = frame->effectiveSandboxFlags(); | 185 result.sandbox_flags = frame->effectiveSandboxFlags(); |
| 185 // result.should_enforce_strict_mixed_content_checking is calculated in the | 186 // result.should_enforce_strict_mixed_content_checking is calculated in the |
| 186 // browser... | 187 // browser... |
| 187 result.origin = frame->getSecurityOrigin(); | 188 result.origin = frame->getSecurityOrigin(); |
| 188 | 189 |
| 189 return result; | 190 return result; |
| 190 } | 191 } |
| 191 | 192 |
| 193 // Returns CommonNavigationParams for a normal navigation to a data: url, with | |
| 194 // navigation_start set to Now() plus the given offet. | |
| 195 CommonNavigationParams MakeCommonNavigationParams( | |
| 196 TimeDelta navigation_start_offset) { | |
| 197 CommonNavigationParams params; | |
| 198 params.url = GURL("data:text/html,<div>Page</div>"); | |
| 199 params.navigation_start = base::TimeTicks::Now() + navigation_start_offset; | |
| 200 params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | |
| 201 params.transition = ui::PAGE_TRANSITION_TYPED; | |
| 202 return params; | |
| 203 } | |
| 204 | |
| 192 } // namespace | 205 } // namespace |
| 193 | 206 |
| 194 class RenderViewImplTest : public RenderViewTest { | 207 class RenderViewImplTest : public RenderViewTest { |
| 195 public: | 208 public: |
| 196 RenderViewImplTest() { | 209 RenderViewImplTest() { |
| 197 // Attach a pseudo keyboard device to this object. | 210 // Attach a pseudo keyboard device to this object. |
| 198 mock_keyboard_.reset(new MockKeyboard()); | 211 mock_keyboard_.reset(new MockKeyboard()); |
| 199 } | 212 } |
| 200 | 213 |
| 201 ~RenderViewImplTest() override {} | 214 ~RenderViewImplTest() override {} |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 // the pending continuation. | 253 // the pending continuation. |
| 241 FrameLoadWaiter(frame()).Wait(); | 254 FrameLoadWaiter(frame()).Wait(); |
| 242 } | 255 } |
| 243 | 256 |
| 244 template<class T> | 257 template<class T> |
| 245 typename T::Param ProcessAndReadIPC() { | 258 typename T::Param ProcessAndReadIPC() { |
| 246 ProcessPendingMessages(); | 259 ProcessPendingMessages(); |
| 247 const IPC::Message* message = | 260 const IPC::Message* message = |
| 248 render_thread_->sink().GetUniqueMessageMatching(T::ID); | 261 render_thread_->sink().GetUniqueMessageMatching(T::ID); |
| 249 typename T::Param param; | 262 typename T::Param param; |
| 250 T::Read(message, ¶m); | 263 EXPECT_TRUE(message); |
| 264 if (message) | |
| 265 T::Read(message, ¶m); | |
| 251 return param; | 266 return param; |
| 252 } | 267 } |
| 253 | 268 |
| 254 // Sends IPC messages that emulates a key-press event. | 269 // Sends IPC messages that emulates a key-press event. |
| 255 int SendKeyEvent(MockKeyboard::Layout layout, | 270 int SendKeyEvent(MockKeyboard::Layout layout, |
| 256 int key_code, | 271 int key_code, |
| 257 MockKeyboard::Modifiers modifiers, | 272 MockKeyboard::Modifiers modifiers, |
| 258 base::string16* output) { | 273 base::string16* output) { |
| 259 #if defined(OS_WIN) | 274 #if defined(OS_WIN) |
| 260 // Retrieve the Unicode character for the given tuple (keyboard-layout, | 275 // Retrieve the Unicode character for the given tuple (keyboard-layout, |
| (...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2032 | 2047 |
| 2033 frame()->SetAccessibilityMode(AccessibilityModeOff); | 2048 frame()->SetAccessibilityMode(AccessibilityModeOff); |
| 2034 ASSERT_EQ(AccessibilityModeOff, frame()->accessibility_mode()); | 2049 ASSERT_EQ(AccessibilityModeOff, frame()->accessibility_mode()); |
| 2035 ASSERT_FALSE(frame()->render_accessibility()); | 2050 ASSERT_FALSE(frame()->render_accessibility()); |
| 2036 | 2051 |
| 2037 frame()->SetAccessibilityMode(AccessibilityModeComplete); | 2052 frame()->SetAccessibilityMode(AccessibilityModeComplete); |
| 2038 ASSERT_EQ(AccessibilityModeComplete, frame()->accessibility_mode()); | 2053 ASSERT_EQ(AccessibilityModeComplete, frame()->accessibility_mode()); |
| 2039 ASSERT_TRUE(frame()->render_accessibility()); | 2054 ASSERT_TRUE(frame()->render_accessibility()); |
| 2040 } | 2055 } |
| 2041 | 2056 |
| 2057 TEST_F(RenderViewImplTest, RendererNavigationStartTransmittedToBrowser) { | |
| 2058 base::TimeTicks lower_bound_navigation_start(base::TimeTicks::Now()); | |
| 2059 frame()->GetWebFrame()->loadHTMLString( | |
| 2060 "hello world", blink::WebURL(GURL("data:text/html,"))); | |
| 2061 | |
| 2062 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = | |
| 2063 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); | |
| 2064 base::TimeTicks transmitted_start = std::get<1>(host_nav_params); | |
| 2065 EXPECT_FALSE(transmitted_start.is_null()); | |
| 2066 EXPECT_LT(lower_bound_navigation_start, transmitted_start); | |
| 2067 } | |
| 2068 | |
| 2069 TEST_F(RenderViewImplTest, BrowserNavigationStart) { | |
| 2070 auto common_params = MakeCommonNavigationParams(-TimeDelta::FromSeconds(1)); | |
| 2071 | |
| 2072 frame()->Navigate(common_params, StartNavigationParams(), | |
| 2073 RequestNavigationParams()); | |
| 2074 FrameHostMsg_DidStartProvisionalLoad::Param nav_params = | |
| 2075 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); | |
| 2076 EXPECT_EQ(common_params.navigation_start, std::get<1>(nav_params)); | |
| 2077 } | |
| 2078 | |
| 2079 TEST_F(RenderViewImplTest, BrowserNavigationStartNonStandard) { | |
| 2080 // Subframes or unload handlers in initial document do not change the game. | |
| 2081 ExecuteJavaScriptForTests( | |
| 2082 "var handler = function() { console.log(42); };" | |
| 2083 "window.onunload = handler;" | |
| 2084 "var frame = document.createElement('iframe');" | |
| 2085 "document.body.appendChild(frame);" | |
| 2086 "frame.contentWindow.onunload = function() { return null; };"); | |
| 2087 // Need to drop the DidStartProvisionalLoad message from the child frame. | |
| 2088 ProcessPendingMessages(); | |
| 2089 render_thread_->sink().ClearMessages(); | |
| 2090 | |
| 2091 auto common_params = MakeCommonNavigationParams(-TimeDelta::FromSeconds(1)); | |
| 2092 // The load type will be ReplaceCurrentItem instead of Standard, but it should | |
| 2093 // not matter. | |
| 2094 common_params.should_replace_current_entry = true; | |
| 2095 | |
| 2096 frame()->Navigate(common_params, StartNavigationParams(), | |
| 2097 RequestNavigationParams()); | |
| 2098 FrameHostMsg_DidStartProvisionalLoad::Param nav_params = | |
| 2099 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); | |
| 2100 EXPECT_EQ(common_params.navigation_start, std::get<1>(nav_params)); | |
| 2101 } | |
| 2102 | |
| 2042 // Sanity check for the Navigation Timing API |navigationStart| override. We | 2103 // Sanity check for the Navigation Timing API |navigationStart| override. We |
| 2043 // are asserting only most basic constraints, as TimeTicks (passed as the | 2104 // are asserting only most basic constraints, as TimeTicks (passed as the |
| 2044 // override) are not comparable with the wall time (returned by the Blink API). | 2105 // override) are not comparable with the wall time (returned by the Blink API). |
| 2045 TEST_F(RenderViewImplTest, NavigationStartOverride) { | 2106 TEST_F(RenderViewImplTest, BrowserNavigationStartSanitized) { |
| 2046 // Verify that a navigation that claims to have started in the future - 42 | 2107 // Verify that a navigation that claims to have started in the future - 42 |
| 2047 // days from now is *not* reported as one that starts in the future; as we | 2108 // days from now is *not* reported as one that starts in the future; as we |
| 2048 // sanitize the override allowing a maximum of ::Now(). | 2109 // sanitize the override allowing a maximum of ::Now(). |
| 2049 CommonNavigationParams late_common_params; | 2110 auto late_common_params = MakeCommonNavigationParams(TimeDelta::FromDays(42)); |
| 2050 late_common_params.url = GURL("data:text/html,<div>Another page</div>"); | |
| 2051 late_common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | |
| 2052 late_common_params.transition = ui::PAGE_TRANSITION_TYPED; | |
| 2053 late_common_params.navigation_start = | |
| 2054 base::TimeTicks::Now() + base::TimeDelta::FromDays(42); | |
| 2055 late_common_params.method = "POST"; | 2111 late_common_params.method = "POST"; |
| 2056 | 2112 |
| 2057 frame()->Navigate(late_common_params, StartNavigationParams(), | 2113 frame()->Navigate(late_common_params, StartNavigationParams(), |
| 2058 RequestNavigationParams()); | 2114 RequestNavigationParams()); |
| 2059 ProcessPendingMessages(); | 2115 ProcessPendingMessages(); |
| 2060 base::Time after_navigation = | 2116 base::Time after_navigation = |
| 2061 base::Time::Now() + base::TimeDelta::FromDays(1); | 2117 base::Time::Now() + base::TimeDelta::FromDays(1); |
| 2062 | 2118 |
| 2063 base::Time late_nav_reported_start = | 2119 base::Time late_nav_reported_start = |
| 2064 base::Time::FromDoubleT(GetMainFrame()->performance().navigationStart()); | 2120 base::Time::FromDoubleT(GetMainFrame()->performance().navigationStart()); |
| 2065 EXPECT_LE(late_nav_reported_start, after_navigation); | 2121 EXPECT_LE(late_nav_reported_start, after_navigation); |
| 2066 } | 2122 } |
| 2067 | 2123 |
| 2068 TEST_F(RenderViewImplTest, RendererNavigationStartTransmittedToBrowser) { | 2124 TEST_F(RenderViewImplTest, FiringBeforeUnloadDiscardsBrowserNavigationStart) { |
| 2069 base::TimeTicks lower_bound_navigation_start; | 2125 // Add a beforeunload handler in the initial document. |
|
Alexander Semashko
2016/06/29 10:11:56
Looks like it had to be initialized to Now(), righ
| |
| 2070 frame()->GetWebFrame()->loadHTMLString( | 2126 ExecuteJavaScriptForTests( |
| 2071 "hello world", blink::WebURL(GURL("data:text/html,"))); | 2127 "window.onbeforeunload = function() { return null; };"); |
| 2128 | |
| 2129 auto common_params = MakeCommonNavigationParams(-TimeDelta::FromSeconds(1)); | |
| 2130 | |
| 2131 frame()->Navigate(common_params, StartNavigationParams(), | |
| 2132 RequestNavigationParams()); | |
| 2133 | |
| 2134 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = | |
| 2135 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); | |
| 2136 EXPECT_GT(std::get<1>(host_nav_params), common_params.navigation_start); | |
| 2137 } | |
| 2138 | |
| 2139 TEST_F(RenderViewImplTest, | |
| 2140 FiringBeforeUnloadInSubFrameDiscardsBrowserNavigationStart) { | |
| 2141 // Add a beforeunload handler in the initial document. | |
| 2142 ExecuteJavaScriptForTests( | |
| 2143 "var frame = document.createElement('iframe');" | |
| 2144 "document.body.appendChild(frame);" | |
| 2145 "frame.contentWindow.onbeforeunload = function() { return null; };"); | |
| 2146 // Need to drop the DidStartProvisionalLoad message from the child frame. | |
| 2072 ProcessPendingMessages(); | 2147 ProcessPendingMessages(); |
| 2073 const IPC::Message* frame_navigate_msg = | 2148 render_thread_->sink().ClearMessages(); |
| 2074 render_thread_->sink().GetUniqueMessageMatching( | 2149 |
| 2075 FrameHostMsg_DidStartProvisionalLoad::ID); | 2150 auto common_params = MakeCommonNavigationParams(-TimeDelta::FromSeconds(1)); |
| 2076 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params; | 2151 frame()->Navigate(common_params, StartNavigationParams(), |
| 2077 FrameHostMsg_DidStartProvisionalLoad::Read(frame_navigate_msg, | 2152 RequestNavigationParams()); |
| 2078 &host_nav_params); | 2153 |
| 2079 base::TimeTicks transmitted_start = std::get<1>(host_nav_params); | 2154 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = |
| 2080 EXPECT_FALSE(transmitted_start.is_null()); | 2155 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); |
| 2081 EXPECT_LT(lower_bound_navigation_start, transmitted_start); | 2156 EXPECT_GT(std::get<1>(host_nav_params), common_params.navigation_start); |
| 2082 } | 2157 } |
| 2083 | 2158 |
| 2084 TEST_F(RenderViewImplTest, BrowserNavigationStartNotUsedForReload) { | 2159 TEST_F(RenderViewImplTest, BrowserNavigationStartNotUsedForReload) { |
| 2085 const char url_string[] = "data:text/html,<div>Page</div>"; | 2160 const char url_string[] = "data:text/html,<div>Page</div>"; |
| 2086 // Navigate once, then reload. | 2161 // Navigate once, then reload. |
| 2087 LoadHTML(url_string); | 2162 LoadHTML(url_string); |
| 2088 ProcessPendingMessages(); | 2163 ProcessPendingMessages(); |
| 2089 render_thread_->sink().ClearMessages(); | 2164 render_thread_->sink().ClearMessages(); |
| 2090 | 2165 |
| 2091 CommonNavigationParams common_params; | 2166 CommonNavigationParams common_params; |
| 2092 common_params.url = GURL(url_string); | 2167 common_params.url = GURL(url_string); |
| 2093 common_params.navigation_type = | 2168 common_params.navigation_type = |
| 2094 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; | 2169 FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL; |
| 2095 common_params.transition = ui::PAGE_TRANSITION_RELOAD; | 2170 common_params.transition = ui::PAGE_TRANSITION_RELOAD; |
| 2096 | 2171 |
| 2172 // The browser navigation_start should not be used because beforeunload will | |
| 2173 // be fired during Navigate. | |
| 2097 frame()->Navigate(common_params, StartNavigationParams(), | 2174 frame()->Navigate(common_params, StartNavigationParams(), |
| 2098 RequestNavigationParams()); | 2175 RequestNavigationParams()); |
| 2099 | 2176 |
| 2100 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = | 2177 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = |
| 2101 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); | 2178 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); |
| 2102 // The true timestamp is later than the browser initiated one. | |
| 2103 EXPECT_PRED2(TimeTicksGT, std::get<1>(host_nav_params), | 2179 EXPECT_PRED2(TimeTicksGT, std::get<1>(host_nav_params), |
| 2104 common_params.navigation_start); | 2180 common_params.navigation_start); |
| 2105 } | 2181 } |
| 2106 | 2182 |
| 2107 TEST_F(RenderViewImplTest, BrowserNavigationStartNotUsedForHistoryNavigation) { | 2183 TEST_F(RenderViewImplTest, |
| 2184 BrowserNavigationStartNotUsedForSameProcessHistoryNavigation) { | |
| 2108 LoadHTML("<div id=pagename>Page A</div>"); | 2185 LoadHTML("<div id=pagename>Page A</div>"); |
| 2109 LoadHTML("<div id=pagename>Page B</div>"); | 2186 LoadHTML("<div id=pagename>Page B</div>"); |
| 2110 PageState back_state = GetCurrentPageState(); | 2187 PageState back_state = GetCurrentPageState(); |
| 2111 LoadHTML("<div id=pagename>Page C</div>"); | 2188 LoadHTML("<div id=pagename>Page C</div>"); |
| 2112 PageState forward_state = GetCurrentPageState(); | 2189 PageState forward_state = GetCurrentPageState(); |
| 2113 ProcessPendingMessages(); | 2190 ProcessPendingMessages(); |
| 2114 render_thread_->sink().ClearMessages(); | 2191 render_thread_->sink().ClearMessages(); |
| 2115 | 2192 |
| 2116 // Go back. | 2193 // Go back. |
| 2194 // The browser navigation_start should not be used because beforeunload will | |
| 2195 // be fired during GoToOffsetWithParams. | |
| 2117 CommonNavigationParams common_params_back; | 2196 CommonNavigationParams common_params_back; |
| 2118 common_params_back.url = | 2197 common_params_back.url = |
| 2119 GURL("data:text/html;charset=utf-8,<div id=pagename>Page B</div>"); | 2198 GURL("data:text/html;charset=utf-8,<div id=pagename>Page B</div>"); |
| 2120 common_params_back.transition = ui::PAGE_TRANSITION_FORWARD_BACK; | 2199 common_params_back.transition = ui::PAGE_TRANSITION_FORWARD_BACK; |
| 2121 GoToOffsetWithParams(-1, back_state, common_params_back, | 2200 GoToOffsetWithParams(-1, back_state, common_params_back, |
| 2122 StartNavigationParams(), RequestNavigationParams()); | 2201 StartNavigationParams(), RequestNavigationParams()); |
| 2123 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = | 2202 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = |
| 2124 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); | 2203 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); |
| 2125 EXPECT_PRED2(TimeTicksGT, std::get<1>(host_nav_params), | 2204 EXPECT_PRED2(TimeTicksGT, std::get<1>(host_nav_params), |
| 2126 common_params_back.navigation_start); | 2205 common_params_back.navigation_start); |
| 2127 render_thread_->sink().ClearMessages(); | 2206 render_thread_->sink().ClearMessages(); |
| 2128 | 2207 |
| 2129 // Go forward. | 2208 // Go forward. |
| 2209 // The browser navigation_start should not be used because beforeunload will | |
| 2210 // be fired during GoToOffsetWithParams. | |
| 2130 CommonNavigationParams common_params_forward; | 2211 CommonNavigationParams common_params_forward; |
| 2131 common_params_forward.url = | 2212 common_params_forward.url = |
| 2132 GURL("data:text/html;charset=utf-8,<div id=pagename>Page C</div>"); | 2213 GURL("data:text/html;charset=utf-8,<div id=pagename>Page C</div>"); |
| 2133 common_params_forward.transition = ui::PAGE_TRANSITION_FORWARD_BACK; | 2214 common_params_forward.transition = ui::PAGE_TRANSITION_FORWARD_BACK; |
| 2134 GoToOffsetWithParams(1, forward_state, common_params_forward, | 2215 GoToOffsetWithParams(1, forward_state, common_params_forward, |
| 2135 StartNavigationParams(), RequestNavigationParams()); | 2216 StartNavigationParams(), RequestNavigationParams()); |
| 2136 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params2 = | 2217 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params2 = |
| 2137 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); | 2218 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); |
| 2138 EXPECT_PRED2(TimeTicksGT, std::get<1>(host_nav_params2), | 2219 EXPECT_PRED2(TimeTicksGT, std::get<1>(host_nav_params2), |
| 2139 common_params_forward.navigation_start); | 2220 common_params_forward.navigation_start); |
| 2140 } | 2221 } |
| 2141 | 2222 |
| 2142 TEST_F(RenderViewImplTest, BrowserNavigationStartSuccessfullyTransmitted) { | 2223 TEST_F(RenderViewImplTest, |
| 2143 CommonNavigationParams common_params; | 2224 BrowserNavigationStartUsedForCrossProcessHistoryNavigation) { |
| 2144 common_params.url = GURL("data:text/html,<div>Page</div>"); | 2225 auto common_params = MakeCommonNavigationParams(-TimeDelta::FromSeconds(1)); |
| 2145 common_params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 2226 common_params.transition = ui::PAGE_TRANSITION_FORWARD_BACK; |
| 2146 common_params.transition = ui::PAGE_TRANSITION_TYPED; | |
| 2147 | 2227 |
| 2148 frame()->Navigate(common_params, StartNavigationParams(), | 2228 RequestNavigationParams request_params; |
| 2149 RequestNavigationParams()); | 2229 request_params.page_state = |
| 2230 PageState::CreateForTesting(common_params.url, false, nullptr, nullptr); | |
| 2231 request_params.page_id = 1; | |
| 2232 request_params.nav_entry_id = 42; | |
| 2233 request_params.pending_history_list_offset = 1; | |
| 2234 request_params.current_history_list_offset = 0; | |
| 2235 request_params.current_history_list_length = 1; | |
| 2236 frame()->Navigate(common_params, StartNavigationParams(), request_params); | |
| 2150 | 2237 |
| 2151 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = | 2238 FrameHostMsg_DidStartProvisionalLoad::Param host_nav_params = |
| 2152 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); | 2239 ProcessAndReadIPC<FrameHostMsg_DidStartProvisionalLoad>(); |
| 2153 EXPECT_EQ(std::get<1>(host_nav_params), common_params.navigation_start); | 2240 EXPECT_EQ(std::get<1>(host_nav_params), common_params.navigation_start); |
| 2154 } | 2241 } |
| 2155 | 2242 |
| 2156 TEST_F(RenderViewImplTest, PreferredSizeZoomed) { | 2243 TEST_F(RenderViewImplTest, PreferredSizeZoomed) { |
| 2157 LoadHTML("<body style='margin:0;'><div style='display:inline-block; " | 2244 LoadHTML("<body style='margin:0;'><div style='display:inline-block; " |
| 2158 "width:400px; height:400px;'/></body>"); | 2245 "width:400px; height:400px;'/></body>"); |
| 2159 view()->webview()->mainFrame()->setCanHaveScrollbars(false); | 2246 view()->webview()->mainFrame()->setCanHaveScrollbars(false); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2496 ExpectPauseAndResume(3); | 2583 ExpectPauseAndResume(3); |
| 2497 blink::WebScriptSource source2( | 2584 blink::WebScriptSource source2( |
| 2498 WebString::fromUTF8("function func2() { func1(); }; func2();")); | 2585 WebString::fromUTF8("function func2() { func1(); }; func2();")); |
| 2499 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); | 2586 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1, 1); |
| 2500 | 2587 |
| 2501 EXPECT_FALSE(IsPaused()); | 2588 EXPECT_FALSE(IsPaused()); |
| 2502 Detach(); | 2589 Detach(); |
| 2503 } | 2590 } |
| 2504 | 2591 |
| 2505 } // namespace content | 2592 } // namespace content |
| OLD | NEW |