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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 302543006: Adds ability to prevent browser connection updates in layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Nits Created 6 years, 6 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/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after
2335 blink::WebPoint point(x, y); 2335 blink::WebPoint point(x, y);
2336 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength); 2336 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))), maxLength);
2337 return surroundingText.content(); 2337 return surroundingText.content();
2338 } 2338 }
2339 2339
2340 void Internals::setFocused(bool focused) 2340 void Internals::setFocused(bool focused)
2341 { 2341 {
2342 frame()->page()->focusController().setFocused(focused); 2342 frame()->page()->focusController().setFocused(focused);
2343 } 2343 }
2344 2344
2345 void Internals::setNetworkStateNotifierTestOnly(bool testOnly)
2346 {
2347 networkStateNotifier().setTestUpdatesOnly(testOnly);
2348 }
2349
2345 void Internals::setNetworkConnectionInfo(const String& type, ExceptionState& exc eptionState) 2350 void Internals::setNetworkConnectionInfo(const String& type, ExceptionState& exc eptionState)
2346 { 2351 {
2347 blink::WebConnectionType webtype; 2352 blink::WebConnectionType webtype;
2348 if (type == "cellular") { 2353 if (type == "cellular") {
2349 webtype = blink::ConnectionTypeCellular; 2354 webtype = blink::ConnectionTypeCellular;
2350 } else if (type == "bluetooth") { 2355 } else if (type == "bluetooth") {
2351 webtype = blink::ConnectionTypeBluetooth; 2356 webtype = blink::ConnectionTypeBluetooth;
2352 } else if (type == "ethernet") { 2357 } else if (type == "ethernet") {
2353 webtype = blink::ConnectionTypeEthernet; 2358 webtype = blink::ConnectionTypeEthernet;
2354 } else if (type == "wifi") { 2359 } else if (type == "wifi") {
2355 webtype = blink::ConnectionTypeWifi; 2360 webtype = blink::ConnectionTypeWifi;
2356 } else if (type == "other") { 2361 } else if (type == "other") {
2357 webtype = blink::ConnectionTypeOther; 2362 webtype = blink::ConnectionTypeOther;
2358 } else if (type == "none") { 2363 } else if (type == "none") {
2359 webtype = blink::ConnectionTypeNone; 2364 webtype = blink::ConnectionTypeNone;
2360 } else { 2365 } else {
2361 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type)); 2366 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type));
2362 return; 2367 return;
2363 } 2368 }
2364 networkStateNotifier().setWebConnectionType(webtype); 2369 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2365 } 2370 }
2366 2371
2367 } // namespace WebCore 2372 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698