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

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

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 TEST_F(WebViewTest, FocusIsInactive) 263 TEST_F(WebViewTest, FocusIsInactive)
264 { 264 {
265 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), "visible_iframe.html"); 265 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), "visible_iframe.html");
266 WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "visib le_iframe.html"); 266 WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "visib le_iframe.html");
267 267
268 webView->setFocus(true); 268 webView->setFocus(true);
269 webView->setIsActive(true); 269 webView->setIsActive(true);
270 WebFrameImpl* frame = toWebFrameImpl(webView->mainFrame()); 270 WebFrameImpl* frame = toWebFrameImpl(webView->mainFrame());
271 EXPECT_TRUE(frame->frame()->document()->isHTMLDocument()); 271 EXPECT_TRUE(frame->frame()->document()->isHTMLDocument());
272 272
273 WebCore::HTMLDocument* document = static_cast<WebCore::HTMLDocument*>(frame- >frame()->document()); 273 WebCore::HTMLDocument* document = WebCore::toHTMLDocument(frame->frame()->do cument());
274 EXPECT_TRUE(document->hasFocus()); 274 EXPECT_TRUE(document->hasFocus());
275 webView->setFocus(false); 275 webView->setFocus(false);
276 webView->setIsActive(false); 276 webView->setIsActive(false);
277 EXPECT_FALSE(document->hasFocus()); 277 EXPECT_FALSE(document->hasFocus());
278 webView->setFocus(true); 278 webView->setFocus(true);
279 webView->setIsActive(true); 279 webView->setIsActive(true);
280 EXPECT_TRUE(document->hasFocus()); 280 EXPECT_TRUE(document->hasFocus());
281 webView->setFocus(true); 281 webView->setFocus(true);
282 webView->setIsActive(false); 282 webView->setIsActive(false);
283 EXPECT_FALSE(document->hasFocus()); 283 EXPECT_FALSE(document->hasFocus());
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 webURLRequestWithTargetStart.initialize(); 1271 webURLRequestWithTargetStart.initialize();
1272 WebCore::FrameLoadRequest requestWithTargetStart(0, webURLRequestWithTargetS tart.toResourceRequest(), WTF::String("_start")); 1272 WebCore::FrameLoadRequest requestWithTargetStart(0, webURLRequestWithTargetS tart.toResourceRequest(), WTF::String("_start"));
1273 toWebViewImpl(client.createdWebView())->page()->mainFrame()->loader()->load( requestWithTargetStart); 1273 toWebViewImpl(client.createdWebView())->page()->mainFrame()->loader()->load( requestWithTargetStart);
1274 EXPECT_TRUE(client.didFocusCalled()); 1274 EXPECT_TRUE(client.didFocusCalled());
1275 1275
1276 client.close(); 1276 client.close();
1277 webViewImpl->close(); 1277 webViewImpl->close();
1278 } 1278 }
1279 1279
1280 } 1280 }
OLDNEW
« no previous file with comments | « Source/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698