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

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 643473002: Made top controls work with virtual viewport pinch-to-zoom. (Blink) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed mac breakage (UseMockScrollbars) Created 6 years, 2 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 | « Source/web/tests/ViewportTest.cpp ('k') | Source/web/tests/data/content-width-1000.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #include "wtf/dtoa/utils.h" 110 #include "wtf/dtoa/utils.h"
111 #include <gmock/gmock.h> 111 #include <gmock/gmock.h>
112 #include <gtest/gtest.h> 112 #include <gtest/gtest.h>
113 #include <map> 113 #include <map>
114 #include <v8.h> 114 #include <v8.h>
115 115
116 namespace { 116 namespace {
117 117
118 using blink::URLTestHelpers::toKURL; 118 using blink::URLTestHelpers::toKURL;
119 using blink::FrameTestHelpers::runPendingTasks; 119 using blink::FrameTestHelpers::runPendingTasks;
120 using blink::FrameTestHelpers::UseMockScrollbarSettings;
120 using namespace blink; 121 using namespace blink;
121 122
122 const int touchPointPadding = 32; 123 const int touchPointPadding = 32;
123 124
124 #define EXPECT_RECT_EQ(a, b) \ 125 #define EXPECT_RECT_EQ(a, b) \
125 do { \ 126 do { \
126 EXPECT_EQ(a.x(), b.x()); \ 127 EXPECT_EQ(a.x(), b.x()); \
127 EXPECT_EQ(a.y(), b.y()); \ 128 EXPECT_EQ(a.y(), b.y()); \
128 EXPECT_EQ(a.width(), b.width()); \ 129 EXPECT_EQ(a.width(), b.width()); \
129 EXPECT_EQ(a.height(), b.height()); \ 130 EXPECT_EQ(a.height(), b.height()); \
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 ASSERT(frame); 232 ASSERT(frame);
232 Element* element = frame->document()->getElementById(testcase.c_str()); 233 Element* element = frame->document()->getElementById(testcase.c_str());
233 return frame->nodeImage(*element); 234 return frame->nodeImage(*element);
234 } 235 }
235 236
236 std::string m_baseURL; 237 std::string m_baseURL;
237 std::string m_notBaseURL; 238 std::string m_notBaseURL;
238 std::string m_chromeURL; 239 std::string m_chromeURL;
239 }; 240 };
240 241
241 class UseMockScrollbarSettings {
242 public:
243 UseMockScrollbarSettings()
244 {
245 Settings::setMockScrollbarsEnabled(true);
246 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true);
247 EXPECT_TRUE(ScrollbarTheme::theme()->usesOverlayScrollbars());
248 }
249
250 ~UseMockScrollbarSettings()
251 {
252 Settings::setMockScrollbarsEnabled(false);
253 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false);
254 }
255 };
256
257 TEST_F(WebFrameTest, ContentText) 242 TEST_F(WebFrameTest, ContentText)
258 { 243 {
259 registerMockedHttpURLLoad("iframes_test.html"); 244 registerMockedHttpURLLoad("iframes_test.html");
260 registerMockedHttpURLLoad("visible_iframe.html"); 245 registerMockedHttpURLLoad("visible_iframe.html");
261 registerMockedHttpURLLoad("invisible_iframe.html"); 246 registerMockedHttpURLLoad("invisible_iframe.html");
262 registerMockedHttpURLLoad("zero_sized_iframe.html"); 247 registerMockedHttpURLLoad("zero_sized_iframe.html");
263 248
264 FrameTestHelpers::WebViewHelper webViewHelper; 249 FrameTestHelpers::WebViewHelper webViewHelper;
265 webViewHelper.initializeAndLoad(m_baseURL + "iframes_test.html"); 250 webViewHelper.initializeAndLoad(m_baseURL + "iframes_test.html");
266 251
(...skipping 6455 matching lines...) Expand 10 before | Expand all | Expand 10 after
6722 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6707 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6723 6708
6724 // Neither should a page reload. 6709 // Neither should a page reload.
6725 localFrame->reload(); 6710 localFrame->reload();
6726 EXPECT_EQ(4u, frameClient.provisionalLoadCount()); 6711 EXPECT_EQ(4u, frameClient.provisionalLoadCount());
6727 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition()); 6712 EXPECT_FALSE(frameClient.wasLastProvisionalLoadATransition());
6728 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount()); 6713 EXPECT_EQ(1u, frameClient.navigationalDataReceivedCount());
6729 } 6714 }
6730 6715
6731 } // namespace 6716 } // namespace
OLDNEW
« no previous file with comments | « Source/web/tests/ViewportTest.cpp ('k') | Source/web/tests/data/content-width-1000.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698