OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 3942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3953 } | 3953 } |
3954 | 3954 |
3955 // Make sure the SubframeBeforeUnloadUseCounter is only incremented on subframe | 3955 // Make sure the SubframeBeforeUnloadUseCounter is only incremented on subframe |
3956 // unloads. crbug.com/635029. | 3956 // unloads. crbug.com/635029. |
3957 TEST_P(WebViewTest, SubframeBeforeUnloadUseCounter) { | 3957 TEST_P(WebViewTest, SubframeBeforeUnloadUseCounter) { |
3958 RegisterMockedHttpURLLoad("visible_iframe.html"); | 3958 RegisterMockedHttpURLLoad("visible_iframe.html"); |
3959 RegisterMockedHttpURLLoad("single_iframe.html"); | 3959 RegisterMockedHttpURLLoad("single_iframe.html"); |
3960 WebViewBase* web_view = web_view_helper_.InitializeAndLoad( | 3960 WebViewBase* web_view = web_view_helper_.InitializeAndLoad( |
3961 base_url_ + "single_iframe.html", true); | 3961 base_url_ + "single_iframe.html", true); |
3962 | 3962 |
3963 WebFrame* frame = web_view_helper_.WebView()->MainFrame(); | 3963 WebLocalFrame* frame = web_view_helper_.WebView()->MainFrameImpl(); |
3964 Document* document = | 3964 Document* document = |
3965 ToLocalFrame(web_view_helper_.WebView()->GetPage()->MainFrame()) | 3965 ToLocalFrame(web_view_helper_.WebView()->GetPage()->MainFrame()) |
3966 ->GetDocument(); | 3966 ->GetDocument(); |
3967 | 3967 |
3968 // Add a beforeunload handler in the main frame. Make sure firing | 3968 // Add a beforeunload handler in the main frame. Make sure firing |
3969 // beforeunload doesn't increment the subframe use counter. | 3969 // beforeunload doesn't increment the subframe use counter. |
3970 { | 3970 { |
3971 frame->ExecuteScript( | 3971 frame->ExecuteScript( |
3972 WebScriptSource("addEventListener('beforeunload', function() {});")); | 3972 WebScriptSource("addEventListener('beforeunload', function() {});")); |
3973 web_view->MainFrame()->ToWebLocalFrame()->DispatchBeforeUnloadEvent(false); | 3973 web_view->MainFrame()->ToWebLocalFrame()->DispatchBeforeUnloadEvent(false); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4338 EXPECT_FALSE(frame_view->VisualViewportSuppliesScrollbars()); | 4338 EXPECT_FALSE(frame_view->VisualViewportSuppliesScrollbars()); |
4339 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 4339 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
4340 EXPECT_NE(nullptr, | 4340 EXPECT_NE(nullptr, |
4341 frame_view->LayoutViewportScrollableArea()->VerticalScrollbar()); | 4341 frame_view->LayoutViewportScrollableArea()->VerticalScrollbar()); |
4342 } else { | 4342 } else { |
4343 EXPECT_NE(nullptr, frame_view->VerticalScrollbar()); | 4343 EXPECT_NE(nullptr, frame_view->VerticalScrollbar()); |
4344 } | 4344 } |
4345 } | 4345 } |
4346 | 4346 |
4347 } // namespace blink | 4347 } // namespace blink |
OLD | NEW |