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

Side by Side Diff: third_party/WebKit/Source/web/LinkHighlightImplTest.cpp

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: yet another mac fix Created 5 years 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 webViewImpl->enableTapHighlightAtPoint(targetedEvent); 195 webViewImpl->enableTapHighlightAtPoint(targetedEvent);
196 ASSERT_TRUE(webViewImpl->linkHighlight(0)); 196 ASSERT_TRUE(webViewImpl->linkHighlight(0));
197 197
198 GraphicsLayer* highlightLayer = webViewImpl->linkHighlight(0)->currentGraphi csLayerForTesting(); 198 GraphicsLayer* highlightLayer = webViewImpl->linkHighlight(0)->currentGraphi csLayerForTesting();
199 ASSERT_TRUE(highlightLayer); 199 ASSERT_TRUE(highlightLayer);
200 EXPECT_TRUE(highlightLayer->linkHighlight(0)); 200 EXPECT_TRUE(highlightLayer->linkHighlight(0));
201 201
202 // Mimic the logic from RenderWidget::Close: 202 // Mimic the logic from RenderWidget::Close:
203 webViewImpl->willCloseLayerTreeView(); 203 webViewImpl->willCloseLayerTreeView();
204 webViewClient.clear();
205 webViewHelper.reset(); 204 webViewHelper.reset();
206 205
207 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); 206 Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
208 } 207 }
209 208
210 TEST(LinkHighlightImplTest, multipleHighlights) 209 TEST(LinkHighlightImplTest, multipleHighlights)
211 { 210 {
212 const std::string baseURL("http://www.test.com/"); 211 const std::string baseURL("http://www.test.com/");
213 const std::string fileName("test_touch_link_highlight.html"); 212 const std::string fileName("test_touch_link_highlight.html");
214 213
(...skipping 17 matching lines...) Expand all
232 IntRect boundingBox(touchEvent.x - touchEvent.data.tap.width / 2, touchEvent .y - touchEvent.data.tap.height / 2, touchEvent.data.tap.width, touchEvent.data. tap.height); 231 IntRect boundingBox(touchEvent.x - touchEvent.data.tap.width / 2, touchEvent .y - touchEvent.data.tap.height / 2, touchEvent.data.tap.width, touchEvent.data. tap.height);
233 findGoodTouchTargets(boundingBox, webViewImpl->mainFrameImpl()->frame(), goo dTargets, highlightNodes); 232 findGoodTouchTargets(boundingBox, webViewImpl->mainFrameImpl()->frame(), goo dTargets, highlightNodes);
234 233
235 webViewImpl->enableTapHighlights(highlightNodes); 234 webViewImpl->enableTapHighlights(highlightNodes);
236 EXPECT_EQ(2U, webViewImpl->numLinkHighlights()); 235 EXPECT_EQ(2U, webViewImpl->numLinkHighlights());
237 236
238 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); 237 Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
239 } 238 }
240 239
241 } // namespace blink 240 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.cpp ('k') | third_party/WebKit/Source/web/PageWidgetDelegate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698