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

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

Issue 122993002: Make calls to AtomicString(const String&) explicit in web/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use AtomicString type for frameName and target Created 6 years, 11 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/WebViewImpl.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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 ViewCreatingWebViewClient client; 1251 ViewCreatingWebViewClient client;
1252 FrameTestHelpers::WebViewHelper m_webViewHelper; 1252 FrameTestHelpers::WebViewHelper m_webViewHelper;
1253 WebViewImpl* webViewImpl = m_webViewHelper.initialize(true, 0, &client); 1253 WebViewImpl* webViewImpl = m_webViewHelper.initialize(true, 0, &client);
1254 webViewImpl->page()->settings().setJavaScriptCanOpenWindowsAutomatically(tru e); 1254 webViewImpl->page()->settings().setJavaScriptCanOpenWindowsAutomatically(tru e);
1255 WebFrameImpl* frame = toWebFrameImpl(webViewImpl->mainFrame()); 1255 WebFrameImpl* frame = toWebFrameImpl(webViewImpl->mainFrame());
1256 frame->setName("_start"); 1256 frame->setName("_start");
1257 1257
1258 // Make a request that will open a new window 1258 // Make a request that will open a new window
1259 WebURLRequest webURLRequest; 1259 WebURLRequest webURLRequest;
1260 webURLRequest.initialize(); 1260 webURLRequest.initialize();
1261 WebCore::FrameLoadRequest request(0, webURLRequest.toResourceRequest(), WTF: :String("_blank")); 1261 WebCore::FrameLoadRequest request(0, webURLRequest.toResourceRequest(), "_bl ank");
1262 webViewImpl->page()->mainFrame()->loader().load(request); 1262 webViewImpl->page()->mainFrame()->loader().load(request);
1263 ASSERT_TRUE(client.createdWebView()); 1263 ASSERT_TRUE(client.createdWebView());
1264 EXPECT_FALSE(client.didFocusCalled()); 1264 EXPECT_FALSE(client.didFocusCalled());
1265 1265
1266 // Make a request from the new window that will navigate the original window . The original window should be focused. 1266 // Make a request from the new window that will navigate the original window . The original window should be focused.
1267 WebURLRequest webURLRequestWithTargetStart; 1267 WebURLRequest webURLRequestWithTargetStart;
1268 webURLRequestWithTargetStart.initialize(); 1268 webURLRequestWithTargetStart.initialize();
1269 WebCore::FrameLoadRequest requestWithTargetStart(0, webURLRequestWithTargetS tart.toResourceRequest(), WTF::String("_start")); 1269 WebCore::FrameLoadRequest requestWithTargetStart(0, webURLRequestWithTargetS tart.toResourceRequest(), "_start");
1270 toWebViewImpl(client.createdWebView())->page()->mainFrame()->loader().load(r equestWithTargetStart); 1270 toWebViewImpl(client.createdWebView())->page()->mainFrame()->loader().load(r equestWithTargetStart);
1271 EXPECT_TRUE(client.didFocusCalled()); 1271 EXPECT_TRUE(client.didFocusCalled());
1272 1272
1273 m_webViewHelper.reset(); // Remove dependency on locally scoped client. 1273 m_webViewHelper.reset(); // Remove dependency on locally scoped client.
1274 } 1274 }
1275 1275
1276 TEST_F(WebViewTest, DispatchesFocusOutFocusInOnViewToggleFocus) 1276 TEST_F(WebViewTest, DispatchesFocusOutFocusInOnViewToggleFocus)
1277 { 1277 {
1278 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), "focusout_focusin_events.html"); 1278 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c _str()), "focusout_focusin_events.html");
1279 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "focusout_f ocusin_events.html", true, 0); 1279 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "focusout_f ocusin_events.html", true, 0);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1403 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html"); 1403 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "smartclip. html");
1404 webView->resize(WebSize(500, 500)); 1404 webView->resize(WebSize(500, 500));
1405 webView->layout(); 1405 webView->layout();
1406 WebRect cropRect(300, 125, 100, 50); 1406 WebRect cropRect(300, 125, 100, 50);
1407 1407
1408 // FIXME: We should test the structure of the data we get back. 1408 // FIXME: We should test the structure of the data we get back.
1409 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty()); 1409 EXPECT_FALSE(webView->getSmartClipData(cropRect).isEmpty());
1410 } 1410 }
1411 1411
1412 } 1412 }
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698