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

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

Issue 962053003: tests: Use runPendingTasks instead of WebThread::enterRunLoop()/exitRunLoop() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 9 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 | Annotate | Revision Log
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/html/HTMLIFrameElement.h" 42 #include "core/html/HTMLIFrameElement.h"
43 #include "core/html/HTMLInputElement.h" 43 #include "core/html/HTMLInputElement.h"
44 #include "core/html/HTMLTextAreaElement.h" 44 #include "core/html/HTMLTextAreaElement.h"
45 #include "core/layout/Layer.h" 45 #include "core/layout/Layer.h"
46 #include "core/layout/LayoutView.h" 46 #include "core/layout/LayoutView.h"
47 #include "core/loader/FrameLoadRequest.h" 47 #include "core/loader/FrameLoadRequest.h"
48 #include "core/page/Chrome.h" 48 #include "core/page/Chrome.h"
49 #include "core/page/Page.h" 49 #include "core/page/Page.h"
50 #include "core/paint/LayerPainter.h" 50 #include "core/paint/LayerPainter.h"
51 #include "core/testing/URLTestHelpers.h" 51 #include "core/testing/URLTestHelpers.h"
52 #include "core/testing/UnitTestHelpers.h"
52 #include "platform/KeyboardCodes.h" 53 #include "platform/KeyboardCodes.h"
53 #include "platform/geometry/IntSize.h" 54 #include "platform/geometry/IntSize.h"
54 #include "platform/graphics/Color.h" 55 #include "platform/graphics/Color.h"
55 #include "public/platform/Platform.h" 56 #include "public/platform/Platform.h"
56 #include "public/platform/WebClipboard.h" 57 #include "public/platform/WebClipboard.h"
57 #include "public/platform/WebDisplayMode.h" 58 #include "public/platform/WebDisplayMode.h"
58 #include "public/platform/WebDragData.h" 59 #include "public/platform/WebDragData.h"
59 #include "public/platform/WebSize.h" 60 #include "public/platform/WebSize.h"
60 #include "public/platform/WebThread.h" 61 #include "public/platform/WebThread.h"
61 #include "public/platform/WebUnitTestSupport.h" 62 #include "public/platform/WebUnitTestSupport.h"
(...skipping 16 matching lines...) Expand all
78 #include "third_party/skia/include/core/SkBitmapDevice.h" 79 #include "third_party/skia/include/core/SkBitmapDevice.h"
79 #include "third_party/skia/include/core/SkCanvas.h" 80 #include "third_party/skia/include/core/SkCanvas.h"
80 #include "web/WebLocalFrameImpl.h" 81 #include "web/WebLocalFrameImpl.h"
81 #include "web/WebSettingsImpl.h" 82 #include "web/WebSettingsImpl.h"
82 #include "web/WebViewImpl.h" 83 #include "web/WebViewImpl.h"
83 #include "web/tests/FrameTestHelpers.h" 84 #include "web/tests/FrameTestHelpers.h"
84 #include <gtest/gtest.h> 85 #include <gtest/gtest.h>
85 86
86 using namespace blink; 87 using namespace blink;
87 using blink::FrameTestHelpers::loadFrame; 88 using blink::FrameTestHelpers::loadFrame;
88 using blink::FrameTestHelpers::runPendingTasks;
89 using blink::URLTestHelpers::toKURL; 89 using blink::URLTestHelpers::toKURL;
90 using blink::testing::runPendingTasks;
90 91
91 namespace { 92 namespace {
92 93
93 enum HorizontalScrollbarState { 94 enum HorizontalScrollbarState {
94 NoHorizontalScrollbar, 95 NoHorizontalScrollbar,
95 VisibleHorizontalScrollbar, 96 VisibleHorizontalScrollbar,
96 }; 97 };
97 98
98 enum VerticalScrollbarState { 99 enum VerticalScrollbarState {
99 NoVerticalScrollbar, 100 NoVerticalScrollbar,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 { 197 {
197 m_chooserCompletion = chooser_completion; 198 m_chooserCompletion = chooser_completion;
198 return true; 199 return true;
199 } 200 }
200 201
201 private: 202 private:
202 WebDateTimeChooserCompletion* m_chooserCompletion; 203 WebDateTimeChooserCompletion* m_chooserCompletion;
203 204
204 }; 205 };
205 206
206 class WebViewTest : public testing::Test { 207 class WebViewTest : public ::testing::Test {
207 public: 208 public:
208 WebViewTest() 209 WebViewTest()
209 : m_baseURL("http://www.test.com/") 210 : m_baseURL("http://www.test.com/")
210 { 211 {
211 } 212 }
212 213
213 virtual void TearDown() 214 virtual void TearDown()
214 { 215 {
215 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); 216 Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
216 } 217 }
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2389 // Test without any preventDefault. 2390 // Test without any preventDefault.
2390 client.reset(); 2391 client.reset();
2391 frame->executeScript(WebScriptSource("setTest('none');")); 2392 frame->executeScript(WebScriptSource("setTest('none');"));
2392 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target"))); 2393 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target")));
2393 EXPECT_TRUE(client.getWasCalled()); 2394 EXPECT_TRUE(client.getWasCalled());
2394 2395
2395 m_webViewHelper.reset(); // Remove dependency on locally scoped client. 2396 m_webViewHelper.reset(); // Remove dependency on locally scoped client.
2396 } 2397 }
2397 2398
2398 } // namespace 2399 } // namespace
OLDNEW
« Source/web/tests/WebFrameTest.cpp ('K') | « Source/web/tests/WebPluginContainerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698