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

Side by Side Diff: third_party/WebKit/Source/web/tests/TopControlsTest.cpp

Issue 2165573003: Simplify tests by using Web*Impl types directly. (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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2015 Google Inc. All rights reserved. 2 * Copyright (C) 2015 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 webViewImpl()->handleInputEvent(generateEvent(WebInputEvent::GestureScro llEnd)); 122 webViewImpl()->handleInputEvent(generateEvent(WebInputEvent::GestureScro llEnd));
123 } 123 }
124 124
125 Element* getElementById(const WebString& id) 125 Element* getElementById(const WebString& id)
126 { 126 {
127 return static_cast<Element*>( 127 return static_cast<Element*>(
128 webViewImpl()->mainFrame()->document().getElementById(id)); 128 webViewImpl()->mainFrame()->document().getElementById(id));
129 } 129 }
130 130
131 131
132 WebViewImpl* webViewImpl() const { return m_helper.webViewImpl(); } 132 WebViewImpl* webViewImpl() const { return m_helper.webView(); }
133 LocalFrame* frame() const { return m_helper.webViewImpl()->mainFrameImpl()-> frame(); } 133 LocalFrame* frame() const { return m_helper.webView()->mainFrameImpl()->fram e(); }
134 VisualViewport& visualViewport() const { return m_helper.webViewImpl()->page ()->frameHost().visualViewport(); } 134 VisualViewport& visualViewport() const { return m_helper.webView()->page()-> frameHost().visualViewport(); }
135 135
136 private: 136 private:
137 std::string m_baseURL; 137 std::string m_baseURL;
138 FrameTestHelpers::WebViewHelper m_helper; 138 FrameTestHelpers::WebViewHelper m_helper;
139 }; 139 };
140 140
141 #define EXPECT_POINT_EQ(expected, actual) \ 141 #define EXPECT_POINT_EQ(expected, actual) \
142 do { \ 142 do { \
143 EXPECT_DOUBLE_EQ((expected).x(), (actual).x()); \ 143 EXPECT_DOUBLE_EQ((expected).x(), (actual).x()); \
144 EXPECT_DOUBLE_EQ((expected).y(), (actual).y()); \ 144 EXPECT_DOUBLE_EQ((expected).y(), (actual).y()); \
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 825
826 ASSERT_EQ(80.f, webView->topControls().contentOffset()); 826 ASSERT_EQ(80.f, webView->topControls().contentOffset());
827 EXPECT_EQ(expectedRootOffset, rootViewport->scrollPosition().y()); 827 EXPECT_EQ(expectedRootOffset, rootViewport->scrollPosition().y());
828 828
829 webView->handleInputEvent( 829 webView->handleInputEvent(
830 generateEvent(WebInputEvent::GestureScrollEnd)); 830 generateEvent(WebInputEvent::GestureScrollEnd));
831 } 831 }
832 } 832 }
833 833
834 } // namespace blink 834 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698