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

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

Issue 339573005: Wrong pending sheets test causing FOUC. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added test 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 | Annotate | Revision Log
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 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after
2330 blink::WebPoint point(x, y); 2330 blink::WebPoint point(x, y);
2331 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredEquivalent( ), maxLength); 2331 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo rPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredEquivalent( ), maxLength);
2332 return surroundingText.content(); 2332 return surroundingText.content();
2333 } 2333 }
2334 2334
2335 void Internals::setFocused(bool focused) 2335 void Internals::setFocused(bool focused)
2336 { 2336 {
2337 frame()->page()->focusController().setFocused(focused); 2337 frame()->page()->focusController().setFocused(focused);
2338 } 2338 }
2339 2339
2340 bool Internals::ignoreLayoutWithPendingStylesheets(Document* document, Exception State& exceptionState)
2341 {
2342 if (!document) {
2343 exceptionState.throwDOMException(InvalidAccessError, "No context documen t is available.");
2344 return false;
2345 }
2346
2347 return document->ignoreLayoutWithPendingStylesheets();
2348 }
2349
2340 void Internals::setNetworkStateNotifierTestOnly(bool testOnly) 2350 void Internals::setNetworkStateNotifierTestOnly(bool testOnly)
2341 { 2351 {
2342 networkStateNotifier().setTestUpdatesOnly(testOnly); 2352 networkStateNotifier().setTestUpdatesOnly(testOnly);
2343 } 2353 }
2344 2354
2345 void Internals::setNetworkConnectionInfo(const String& type, ExceptionState& exc eptionState) 2355 void Internals::setNetworkConnectionInfo(const String& type, ExceptionState& exc eptionState)
2346 { 2356 {
2347 blink::WebConnectionType webtype; 2357 blink::WebConnectionType webtype;
2348 if (type == "cellular") { 2358 if (type == "cellular") {
2349 webtype = blink::ConnectionTypeCellular; 2359 webtype = blink::ConnectionTypeCellular;
2350 } else if (type == "bluetooth") { 2360 } else if (type == "bluetooth") {
2351 webtype = blink::ConnectionTypeBluetooth; 2361 webtype = blink::ConnectionTypeBluetooth;
2352 } else if (type == "ethernet") { 2362 } else if (type == "ethernet") {
2353 webtype = blink::ConnectionTypeEthernet; 2363 webtype = blink::ConnectionTypeEthernet;
2354 } else if (type == "wifi") { 2364 } else if (type == "wifi") {
2355 webtype = blink::ConnectionTypeWifi; 2365 webtype = blink::ConnectionTypeWifi;
2356 } else if (type == "other") { 2366 } else if (type == "other") {
2357 webtype = blink::ConnectionTypeOther; 2367 webtype = blink::ConnectionTypeOther;
2358 } else if (type == "none") { 2368 } else if (type == "none") {
2359 webtype = blink::ConnectionTypeNone; 2369 webtype = blink::ConnectionTypeNone;
2360 } else { 2370 } else {
2361 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type)); 2371 exceptionState.throwDOMException(NotFoundError, ExceptionMessages::faile dToEnumerate("connection type", type));
2362 return; 2372 return;
2363 } 2373 }
2364 networkStateNotifier().setWebConnectionTypeForTest(webtype); 2374 networkStateNotifier().setWebConnectionTypeForTest(webtype);
2365 } 2375 }
2366 2376
2367 } // namespace WebCore 2377 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698