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

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: Rebase 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
« 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 2370 matching lines...) Expand 10 before | Expand all | Expand 10 after
2381 { 2381 {
2382 ASSERT(document); 2382 ASSERT(document);
2383 return document->ignoreLayoutWithPendingStylesheets(); 2383 return document->ignoreLayoutWithPendingStylesheets();
2384 } 2384 }
2385 2385
2386 void Internals::setNetworkStateNotifierTestOnly(bool testOnly) 2386 void Internals::setNetworkStateNotifierTestOnly(bool testOnly)
2387 { 2387 {
2388 networkStateNotifier().setTestUpdatesOnly(testOnly); 2388 networkStateNotifier().setTestUpdatesOnly(testOnly);
2389 } 2389 }
2390 2390
2391 void Internals::setNetworkConnectionInfo(const String& type, ExceptionState& exc eptionState) 2391 void Internals::setNetworkConnectionInfo(const String& type, double downlinkMaxM bps, ExceptionState& exceptionState)
2392 { 2392 {
2393 WebConnectionType webtype; 2393 WebConnectionType webtype;
2394 if (type == "cellular") { 2394 if (type == "cellular") {
2395 webtype = ConnectionTypeCellular; 2395 webtype = ConnectionTypeCellular;
2396 } else if (type == "bluetooth") { 2396 } else if (type == "bluetooth") {
2397 webtype = ConnectionTypeBluetooth; 2397 webtype = ConnectionTypeBluetooth;
2398 } else if (type == "ethernet") { 2398 } else if (type == "ethernet") {
2399 webtype = ConnectionTypeEthernet; 2399 webtype = ConnectionTypeEthernet;
2400 } else if (type == "wifi") { 2400 } else if (type == "wifi") {
2401 webtype = ConnectionTypeWifi; 2401 webtype = ConnectionTypeWifi;
2402 } else if (type == "wimax") {
2403 webtype = ConnectionTypeWimax;
2402 } else if (type == "other") { 2404 } else if (type == "other") {
2403 webtype = ConnectionTypeOther; 2405 webtype = ConnectionTypeOther;
2404 } else if (type == "none") { 2406 } else if (type == "none") {
2405 webtype = ConnectionTypeNone; 2407 webtype = ConnectionTypeNone;
2406 } else if (type == "unknown") { 2408 } else if (type == "unknown") {
2407 webtype = ConnectionTypeUnknown; 2409 webtype = ConnectionTypeUnknown;
2408 } else { 2410 } else {
2409 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type)); 2411 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type));
2410 return; 2412 return;
2411 } 2413 }
2412 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2414 networkStateNotifier().setWebConnectionForTest(webtype, downlinkMaxMbps);
2413 } 2415 }
2414 2416
2415 unsigned Internals::countHitRegions(CanvasRenderingContext* context) 2417 unsigned Internals::countHitRegions(CanvasRenderingContext* context)
2416 { 2418 {
2417 return context->hitRegionsCount(); 2419 return context->hitRegionsCount();
2418 } 2420 }
2419 2421
2420 bool Internals::isInCanvasFontCache(Document* document, const String& fontString ) 2422 bool Internals::isInCanvasFontCache(Document* document, const String& fontString )
2421 { 2423 {
2422 return document->canvasFontCache()->isInCache(fontString); 2424 return document->canvasFontCache()->isInCache(fontString);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 2522
2521 return animator->setScrollbarsVisibleForTesting(visible); 2523 return animator->setScrollbarsVisibleForTesting(visible);
2522 } 2524 }
2523 2525
2524 void Internals::forceRestrictIFramePermissions() 2526 void Internals::forceRestrictIFramePermissions()
2525 { 2527 {
2526 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true); 2528 RuntimeEnabledFeatures::setRestrictIFramePermissionsEnabled(true);
2527 } 2529 }
2528 2530
2529 } // namespace blink 2531 } // namespace blink
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