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

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

Issue 1413513009: Use mocked scrollbar in webkit unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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) 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 void testAutoResize(const WebSize& minAutoResize, const WebSize& maxAutoResi ze, 236 void testAutoResize(const WebSize& minAutoResize, const WebSize& maxAutoResi ze,
237 const std::string& pageWidth, const std::string& pageHei ght, 237 const std::string& pageWidth, const std::string& pageHei ght,
238 int expectedWidth, int expectedHeight, 238 int expectedWidth, int expectedHeight,
239 HorizontalScrollbarState expectedHorizontalState, Vertic alScrollbarState expectedVerticalState); 239 HorizontalScrollbarState expectedHorizontalState, Vertic alScrollbarState expectedVerticalState);
240 240
241 void testTextInputType(WebTextInputType expectedType, const std::string& htm lFile); 241 void testTextInputType(WebTextInputType expectedType, const std::string& htm lFile);
242 void testInputMode(const WebString& expectedInputMode, const std::string& ht mlFile); 242 void testInputMode(const WebString& expectedInputMode, const std::string& ht mlFile);
243 243
244 std::string m_baseURL; 244 std::string m_baseURL;
245 FrameTestHelpers::WebViewHelper m_webViewHelper; 245 FrameTestHelpers::WebViewHelper m_webViewHelper;
246 FrameTestHelpers::UseMockScrollbarSettings m_mockScrollbarSettings;
246 }; 247 };
247 248
248 TEST_F(WebViewTest, SaveImageAt) 249 TEST_F(WebViewTest, SaveImageAt)
249 { 250 {
250 SaveImageFromDataURLWebViewClient client; 251 SaveImageFromDataURLWebViewClient client;
251 252
252 std::string url = m_baseURL + "image-with-data-url.html"; 253 std::string url = m_baseURL + "image-with-data-url.html";
253 URLTestHelpers::registerMockedURLLoad(toKURL(url), "image-with-data-url.html "); 254 URLTestHelpers::registerMockedURLLoad(toKURL(url), "image-with-data-url.html ");
254 URLTestHelpers::registerMockedURLLoad(toKURL("http://test"), "white-1x1.png" ); 255 URLTestHelpers::registerMockedURLLoad(toKURL("http://test"), "white-1x1.png" );
255 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(url, true, 0, &clie nt); 256 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(url, true, 0, &clie nt);
(...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after
3107 WebFrame* frame = mainWebView.webView()->mainFrame(); 3108 WebFrame* frame = mainWebView.webView()->mainFrame();
3108 v8::HandleScope scope(v8::Isolate::GetCurrent()); 3109 v8::HandleScope scope(v8::Isolate::GetCurrent());
3109 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS ource("var win = window.open('javascript:false'); win.document")); 3110 v8::Local<v8::Value> v8Value = frame->executeScriptAndReturnValue(WebScriptS ource("var win = window.open('javascript:false'); win.document"));
3110 ASSERT_TRUE(v8Value->IsObject()); 3111 ASSERT_TRUE(v8Value->IsObject());
3111 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent (), v8Value); 3112 Document* document = V8Document::toImplWithTypeCheck(v8::Isolate::GetCurrent (), v8Value);
3112 ASSERT_TRUE(document); 3113 ASSERT_TRUE(document);
3113 EXPECT_FALSE(document->frame()->isLoading()); 3114 EXPECT_FALSE(document->frame()->isLoading());
3114 } 3115 }
3115 3116
3116 } // namespace blink 3117 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698