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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 #include "public/web/WebViewClient.h" | 89 #include "public/web/WebViewClient.h" |
90 #include "public/web/WebWidget.h" | 90 #include "public/web/WebWidget.h" |
91 #include "public/web/WebWidgetClient.h" | 91 #include "public/web/WebWidgetClient.h" |
92 #include "testing/gtest/include/gtest/gtest.h" | 92 #include "testing/gtest/include/gtest/gtest.h" |
93 #include "third_party/skia/include/core/SkBitmap.h" | 93 #include "third_party/skia/include/core/SkBitmap.h" |
94 #include "third_party/skia/include/core/SkCanvas.h" | 94 #include "third_party/skia/include/core/SkCanvas.h" |
95 #include "web/WebLocalFrameImpl.h" | 95 #include "web/WebLocalFrameImpl.h" |
96 #include "web/WebSettingsImpl.h" | 96 #include "web/WebSettingsImpl.h" |
97 #include "web/WebViewImpl.h" | 97 #include "web/WebViewImpl.h" |
98 #include "web/tests/FrameTestHelpers.h" | 98 #include "web/tests/FrameTestHelpers.h" |
| 99 #include "wtf/PtrUtil.h" |
| 100 #include <memory> |
99 | 101 |
100 #if OS(MACOSX) | 102 #if OS(MACOSX) |
101 #include "public/web/mac/WebSubstringUtil.h" | 103 #include "public/web/mac/WebSubstringUtil.h" |
102 #endif | 104 #endif |
103 | 105 |
104 using blink::FrameTestHelpers::loadFrame; | 106 using blink::FrameTestHelpers::loadFrame; |
105 using blink::URLTestHelpers::toKURL; | 107 using blink::URLTestHelpers::toKURL; |
106 using blink::URLTestHelpers::registerMockedURLLoad; | 108 using blink::URLTestHelpers::registerMockedURLLoad; |
107 using blink::testing::runPendingTasks; | 109 using blink::testing::runPendingTasks; |
108 | 110 |
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 } | 1859 } |
1858 | 1860 |
1859 static void configueCompositingWebView(WebSettings* settings) | 1861 static void configueCompositingWebView(WebSettings* settings) |
1860 { | 1862 { |
1861 settings->setAcceleratedCompositingEnabled(true); | 1863 settings->setAcceleratedCompositingEnabled(true); |
1862 settings->setPreferCompositingToLCDTextEnabled(true); | 1864 settings->setPreferCompositingToLCDTextEnabled(true); |
1863 } | 1865 } |
1864 | 1866 |
1865 TEST_F(WebViewTest, ShowPressOnTransformedLink) | 1867 TEST_F(WebViewTest, ShowPressOnTransformedLink) |
1866 { | 1868 { |
1867 OwnPtr<FrameTestHelpers::TestWebViewClient> fakeCompositingWebViewClient = a
doptPtr(new FrameTestHelpers::TestWebViewClient()); | 1869 std::unique_ptr<FrameTestHelpers::TestWebViewClient> fakeCompositingWebViewC
lient = wrapUnique(new FrameTestHelpers::TestWebViewClient()); |
1868 FrameTestHelpers::WebViewHelper webViewHelper; | 1870 FrameTestHelpers::WebViewHelper webViewHelper; |
1869 WebViewImpl* webViewImpl = webViewHelper.initialize(true, nullptr, fakeCompo
sitingWebViewClient.get(), nullptr, &configueCompositingWebView); | 1871 WebViewImpl* webViewImpl = webViewHelper.initialize(true, nullptr, fakeCompo
sitingWebViewClient.get(), nullptr, &configueCompositingWebView); |
1870 | 1872 |
1871 int pageWidth = 640; | 1873 int pageWidth = 640; |
1872 int pageHeight = 480; | 1874 int pageHeight = 480; |
1873 webViewImpl->resize(WebSize(pageWidth, pageHeight)); | 1875 webViewImpl->resize(WebSize(pageWidth, pageHeight)); |
1874 | 1876 |
1875 WebURL baseURL = URLTestHelpers::toKURL("http://example.com/"); | 1877 WebURL baseURL = URLTestHelpers::toKURL("http://example.com/"); |
1876 FrameTestHelpers::loadHTMLString(webViewImpl->mainFrame(), "<a href='http://
www.test.com' style='position: absolute; left: 20px; top: 20px; width: 200px; tr
ansform:translateZ(0);'>A link to highlight</a>", baseURL); | 1878 FrameTestHelpers::loadHTMLString(webViewImpl->mainFrame(), "<a href='http://
www.test.com' style='position: absolute; left: 20px; top: 20px; width: 200px; tr
ansform:translateZ(0);'>A link to highlight</a>", baseURL); |
1877 | 1879 |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3177 frame->setAutofillClient(&client); | 3179 frame->setAutofillClient(&client); |
3178 webView->setInitialFocus(false); | 3180 webView->setInitialFocus(false); |
3179 | 3181 |
3180 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3182 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
3181 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3183 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
3182 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3184 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
3183 frame->setAutofillClient(0); | 3185 frame->setAutofillClient(0); |
3184 } | 3186 } |
3185 | 3187 |
3186 } // namespace blink | 3188 } // namespace blink |
OLD | NEW |