| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "core/dom/Document.h" | 5 #include "core/dom/Document.h" |
| 6 #include "core/dom/Element.h" | 6 #include "core/dom/Element.h" |
| 7 #include "core/dom/Node.h" | 7 #include "core/dom/Node.h" |
| 8 #include "core/html/HTMLElement.h" | 8 #include "core/html/HTMLElement.h" |
| 9 #include "platform/testing/URLTestHelpers.h" | 9 #include "platform/testing/URLTestHelpers.h" |
| 10 #include "platform/testing/UnitTestHelpers.h" | 10 #include "platform/testing/UnitTestHelpers.h" |
| 11 #include "public/platform/Platform.h" | 11 #include "public/platform/Platform.h" |
| 12 #include "public/platform/WebCache.h" | |
| 13 #include "public/platform/WebURLLoaderMockFactory.h" | 12 #include "public/platform/WebURLLoaderMockFactory.h" |
| 14 #include "public/web/WebDocument.h" | 13 #include "public/web/WebDocument.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "web/WebLocalFrameImpl.h" | 15 #include "web/WebLocalFrameImpl.h" |
| 17 #include "web/tests/FrameTestHelpers.h" | 16 #include "web/tests/FrameTestHelpers.h" |
| 18 | 17 |
| 19 using blink::FrameTestHelpers::loadFrame; | 18 using blink::FrameTestHelpers::loadFrame; |
| 20 using blink::testing::runPendingTasks; | 19 using blink::testing::runPendingTasks; |
| 21 using blink::URLTestHelpers::registerMockedURLLoadFromBase; | 20 using blink::URLTestHelpers::registerMockedURLLoadFromBase; |
| 22 | 21 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 | 38 |
| 40 private: | 39 private: |
| 41 int m_virtualKeyboardRequestCount; | 40 int m_virtualKeyboardRequestCount; |
| 42 }; | 41 }; |
| 43 | 42 |
| 44 class ImeOnFocusTest : public ::testing::Test { | 43 class ImeOnFocusTest : public ::testing::Test { |
| 45 public: | 44 public: |
| 46 ImeOnFocusTest() : m_baseURL("http://www.test.com/") {} | 45 ImeOnFocusTest() : m_baseURL("http://www.test.com/") {} |
| 47 | 46 |
| 48 void TearDown() override { | 47 void TearDown() override { |
| 49 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 48 Platform::current() |
| 50 WebCache::clear(); | 49 ->getURLLoaderMockFactory() |
| 50 ->unregisterAllURLsAndClearMemoryCache(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 void sendGestureTap(WebView*, IntPoint); | 54 void sendGestureTap(WebView*, IntPoint); |
| 55 void focus(const AtomicString& element); | 55 void focus(const AtomicString& element); |
| 56 void runImeOnFocusTest(std::string fileName, | 56 void runImeOnFocusTest(std::string fileName, |
| 57 int, | 57 int, |
| 58 IntPoint tapPoint = IntPoint(-1, -1), | 58 IntPoint tapPoint = IntPoint(-1, -1), |
| 59 const AtomicString& focusElement = nullAtom, | 59 const AtomicString& focusElement = nullAtom, |
| 60 std::string frame = ""); | 60 std::string frame = ""); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 runImeOnFocusTest("ime-on-focus-after-navigation-within-page.html", 1, | 145 runImeOnFocusTest("ime-on-focus-after-navigation-within-page.html", 1, |
| 146 IntPoint(50, 50), "input"); | 146 IntPoint(50, 50), "input"); |
| 147 } | 147 } |
| 148 | 148 |
| 149 TEST_F(ImeOnFocusTest, AfterFrameLoadOnGesture) { | 149 TEST_F(ImeOnFocusTest, AfterFrameLoadOnGesture) { |
| 150 runImeOnFocusTest("ime-on-focus-after-frame-load-on-gesture.html", 1, | 150 runImeOnFocusTest("ime-on-focus-after-frame-load-on-gesture.html", 1, |
| 151 IntPoint(50, 50), "input", "frame.html"); | 151 IntPoint(50, 50), "input", "frame.html"); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace blink | 154 } // namespace blink |
| OLD | NEW |