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

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

Issue 1308943005: [NetInfo] Add Blink support for connection.change, connection.downlinkMax, and wimax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update test expectations Created 5 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
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 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 { 2336 {
2337 ASSERT(document); 2337 ASSERT(document);
2338 return document->ignoreLayoutWithPendingStylesheets(); 2338 return document->ignoreLayoutWithPendingStylesheets();
2339 } 2339 }
2340 2340
2341 void Internals::setNetworkStateNotifierTestOnly(bool testOnly) 2341 void Internals::setNetworkStateNotifierTestOnly(bool testOnly)
2342 { 2342 {
2343 networkStateNotifier().setTestUpdatesOnly(testOnly); 2343 networkStateNotifier().setTestUpdatesOnly(testOnly);
2344 } 2344 }
2345 2345
2346 void Internals::setNetworkConnectionInfo(const String& type, ExceptionState& exc eptionState) 2346 void Internals::setNetworkConnectionInfo(const String& type, double downlinkMax, ExceptionState& exceptionState)
2347 { 2347 {
2348 WebConnectionType webtype; 2348 WebConnectionType webtype;
2349 if (type == "cellular") { 2349 if (type == "cellular") {
2350 webtype = ConnectionTypeCellular; 2350 webtype = ConnectionTypeCellular;
2351 } else if (type == "bluetooth") { 2351 } else if (type == "bluetooth") {
2352 webtype = ConnectionTypeBluetooth; 2352 webtype = ConnectionTypeBluetooth;
2353 } else if (type == "ethernet") { 2353 } else if (type == "ethernet") {
2354 webtype = ConnectionTypeEthernet; 2354 webtype = ConnectionTypeEthernet;
2355 } else if (type == "wifi") { 2355 } else if (type == "wifi") {
2356 webtype = ConnectionTypeWifi; 2356 webtype = ConnectionTypeWifi;
2357 } else if (type == "wimax") {
2358 webtype = ConnectionTypeWimax;
2357 } else if (type == "other") { 2359 } else if (type == "other") {
2358 webtype = ConnectionTypeOther; 2360 webtype = ConnectionTypeOther;
2359 } else if (type == "none") { 2361 } else if (type == "none") {
2360 webtype = ConnectionTypeNone; 2362 webtype = ConnectionTypeNone;
2361 } else if (type == "unknown") { 2363 } else if (type == "unknown") {
2362 webtype = ConnectionTypeUnknown; 2364 webtype = ConnectionTypeUnknown;
2363 } else { 2365 } else {
2364 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type)); 2366 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type));
2365 return; 2367 return;
2366 } 2368 }
2367 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2369 networkStateNotifier().setWebConnectionForTest(webtype, downlinkMax);
2368 } 2370 }
2369 2371
2370 unsigned Internals::countHitRegions(CanvasRenderingContext* context) 2372 unsigned Internals::countHitRegions(CanvasRenderingContext* context)
2371 { 2373 {
2372 return context->hitRegionsCount(); 2374 return context->hitRegionsCount();
2373 } 2375 }
2374 2376
2375 bool Internals::isInCanvasFontCache(Document* document, const String& fontString ) 2377 bool Internals::isInCanvasFontCache(Document* document, const String& fontString )
2376 { 2378 {
2377 return document->canvasFontCache()->isInCache(fontString); 2379 return document->canvasFontCache()->isInCache(fontString);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 2481
2480 return animator->setScrollbarsVisibleForTesting(visible); 2482 return animator->setScrollbarsVisibleForTesting(visible);
2481 } 2483 }
2482 2484
2483 void Internals::forceRestrictIFramePermissions() 2485 void Internals::forceRestrictIFramePermissions()
2484 { 2486 {
2485 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); 2487 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true);
2486 } 2488 }
2487 2489
2488 } // namespace blink 2490 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698