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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |