 Chromium Code Reviews
 Chromium Code Reviews Issue 2874073003:
  Add layout tests for ImageLoader::UpdateFromElement(kUpdateForcedReload)  (Closed)
    
  
    Issue 2874073003:
  Add layout tests for ImageLoader::UpdateFromElement(kUpdateForcedReload)  (Closed) 
  | OLD | NEW | 
|---|---|
| 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 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2774 String Internals::markerTextForListItem(Element* element) { | 2774 String Internals::markerTextForListItem(Element* element) { | 
| 2775 DCHECK(element); | 2775 DCHECK(element); | 
| 2776 return blink::MarkerTextForListItem(element); | 2776 return blink::MarkerTextForListItem(element); | 
| 2777 } | 2777 } | 
| 2778 | 2778 | 
| 2779 String Internals::getImageSourceURL(Element* element) { | 2779 String Internals::getImageSourceURL(Element* element) { | 
| 2780 DCHECK(element); | 2780 DCHECK(element); | 
| 2781 return element->ImageSourceURL(); | 2781 return element->ImageSourceURL(); | 
| 2782 } | 2782 } | 
| 2783 | 2783 | 
| 2784 void Internals::forceImageReload(Element* element) { | |
| 2785 DCHECK(element); | |
| 2786 DCHECK(isHTMLImageElement(*element)); | |
| 
kouhei (in TOK)
2017/05/11 16:50:52
replace DCHECKs w/ if (element && isHTMLImageEleme
 
hiroshige
2017/05/11 17:11:44
Because this is Internals, and for debugging/testi
 
kouhei (in TOK)
2017/05/11 17:30:14
Other Intenals API throws an exception or silently
 
hiroshige
2017/05/11 18:12:15
Sounds good. Done.
 | |
| 2787 toHTMLImageElement(*element).ForceReload(); | |
| 2788 } | |
| 2789 | |
| 2784 String Internals::selectMenuListText(HTMLSelectElement* select) { | 2790 String Internals::selectMenuListText(HTMLSelectElement* select) { | 
| 2785 DCHECK(select); | 2791 DCHECK(select); | 
| 2786 LayoutObject* layout_object = select->GetLayoutObject(); | 2792 LayoutObject* layout_object = select->GetLayoutObject(); | 
| 2787 if (!layout_object || !layout_object->IsMenuList()) | 2793 if (!layout_object || !layout_object->IsMenuList()) | 
| 2788 return String(); | 2794 return String(); | 
| 2789 | 2795 | 
| 2790 LayoutMenuListItem menu_list_item = | 2796 LayoutMenuListItem menu_list_item = | 
| 2791 LayoutMenuListItem(ToLayoutMenuList(layout_object)); | 2797 LayoutMenuListItem(ToLayoutMenuList(layout_object)); | 
| 2792 return menu_list_item.GetText(); | 2798 return menu_list_item.GetText(); | 
| 2793 } | 2799 } | 
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3271 | 3277 | 
| 3272 void Internals::crash() { | 3278 void Internals::crash() { | 
| 3273 CHECK(false) << "Intentional crash"; | 3279 CHECK(false) << "Intentional crash"; | 
| 3274 } | 3280 } | 
| 3275 | 3281 | 
| 3276 void Internals::setIsLowEndDevice(bool is_low_end_device) { | 3282 void Internals::setIsLowEndDevice(bool is_low_end_device) { | 
| 3277 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); | 3283 MemoryCoordinator::SetIsLowEndDeviceForTesting(is_low_end_device); | 
| 3278 } | 3284 } | 
| 3279 | 3285 | 
| 3280 } // namespace blink | 3286 } // namespace blink | 
| OLD | NEW |