Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: ios/web/web_state/ui/crw_web_controller_unittest.mm

Issue 2134873002: [ios] Fixed SetPageDisplayStateWithUserScalableEnabled test for iOS 10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "ios/web/web_state/ui/crw_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <WebKit/WebKit.h> 7 #import <WebKit/WebKit.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 return web_controller().pageDisplayState.scroll_state().offset_x() == 1.0; 750 return web_controller().pageDisplayState.scroll_state().offset_x() == 1.0;
751 }); 751 });
752 752
753 ASSERT_EQ(original_zoom_state, 753 ASSERT_EQ(original_zoom_state,
754 web_controller().pageDisplayState.zoom_state()); 754 web_controller().pageDisplayState.zoom_state());
755 }; 755 };
756 756
757 // TODO(iOS): Flaky on the bots. crbug/493427 757 // TODO(iOS): Flaky on the bots. crbug/493427
758 TEST_F(CRWWebControllerPageScrollStateTest, 758 TEST_F(CRWWebControllerPageScrollStateTest,
759 FLAKY_SetPageDisplayStateWithUserScalableEnabled) { 759 FLAKY_SetPageDisplayStateWithUserScalableEnabled) {
760 web::PageZoomState zoom_state(1.0, 10.0, 1.0); 760 web::PageZoomState zoom_state(1.0, 5.0, 1.0);
761
761 LoadHtml(GetHTMLForZoomState(zoom_state, PAGE_SCALABILITY_ENABLED)); 762 LoadHtml(GetHTMLForZoomState(zoom_state, PAGE_SCALABILITY_ENABLED));
762 WaitForZoomRendering(web_controller(), zoom_state); 763 WaitForZoomRendering(web_controller(), zoom_state);
763 764
764 web::NavigationManager* nagivation_manager = 765 web::NavigationManager* nagivation_manager =
765 web_state()->GetNavigationManager(); 766 web_state()->GetNavigationManager();
766 nagivation_manager->GetLastCommittedItem()->SetPageDisplayState( 767 nagivation_manager->GetLastCommittedItem()->SetPageDisplayState(
767 CreateTestPageDisplayState(CGPointMake(1.0, 1.0), // scroll offset 768 CreateTestPageDisplayState(CGPointMake(1.0, 1.0), // scroll offset
768 3.0, // relative zoom scale 769 3.0, // relative zoom scale
769 1.0, // original minimum zoom scale 770 1.0, // original minimum zoom scale
770 10.0, // original maximum zoom scale 771 5.0, // original maximum zoom scale
771 1.0)); // original zoom scale 772 1.0)); // original zoom scale
772 [web_controller() restoreStateFromHistory]; 773 [web_controller() restoreStateFromHistory];
773 774
774 // |-restoreStateFromHistory| is async; wait for its completion. 775 // |-restoreStateFromHistory| is async; wait for its completion.
775 base::test::ios::WaitUntilCondition(^bool() { 776 base::test::ios::WaitUntilCondition(^bool() {
776 return web_controller().pageDisplayState.scroll_state().offset_x() == 1.0; 777 return web_controller().pageDisplayState.scroll_state().offset_x() == 1.0;
777 }); 778 });
778 779
779 web::PageZoomState final_zoom_state = 780 web::PageZoomState final_zoom_state =
780 web_controller().pageDisplayState.zoom_state(); 781 web_controller().pageDisplayState.zoom_state();
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 1065
1065 [web_controller() setDelegate:delegate]; 1066 [web_controller() setDelegate:delegate];
1066 web::SimulateWKWebViewCrash(webView_); 1067 web::SimulateWKWebViewCrash(webView_);
1067 1068
1068 EXPECT_OCMOCK_VERIFY(delegate); 1069 EXPECT_OCMOCK_VERIFY(delegate);
1069 EXPECT_FALSE([web_controller() isViewAlive]); 1070 EXPECT_FALSE([web_controller() isViewAlive]);
1070 [web_controller() setDelegate:nil]; 1071 [web_controller() setDelegate:nil];
1071 }; 1072 };
1072 1073
1073 } // namespace 1074 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698