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

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

Issue 38743004: Remove modules/speech dependencies from Internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: patch Created 7 years, 2 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 #include "core/page/PrintContext.h" 100 #include "core/page/PrintContext.h"
101 #include "core/page/Settings.h" 101 #include "core/page/Settings.h"
102 #include "core/frame/animation/AnimationController.h" 102 #include "core/frame/animation/AnimationController.h"
103 #include "core/page/scrolling/ScrollingCoordinator.h" 103 #include "core/page/scrolling/ScrollingCoordinator.h"
104 #include "core/platform/ColorChooser.h" 104 #include "core/platform/ColorChooser.h"
105 #include "core/platform/Cursor.h" 105 #include "core/platform/Cursor.h"
106 #include "core/platform/graphics/GraphicsLayer.h" 106 #include "core/platform/graphics/GraphicsLayer.h"
107 #include "core/platform/graphics/filters/FilterOperation.h" 107 #include "core/platform/graphics/filters/FilterOperation.h"
108 #include "core/platform/graphics/filters/FilterOperations.h" 108 #include "core/platform/graphics/filters/FilterOperations.h"
109 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" 109 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h"
110 #include "core/platform/mock/PlatformSpeechSynthesizerMock.h"
111 #include "core/rendering/CompositedLayerMapping.h" 110 #include "core/rendering/CompositedLayerMapping.h"
112 #include "core/rendering/RenderLayer.h" 111 #include "core/rendering/RenderLayer.h"
113 #include "core/rendering/RenderLayerCompositor.h" 112 #include "core/rendering/RenderLayerCompositor.h"
114 #include "core/rendering/RenderMenuList.h" 113 #include "core/rendering/RenderMenuList.h"
115 #include "core/rendering/RenderObject.h" 114 #include "core/rendering/RenderObject.h"
116 #include "core/rendering/RenderTreeAsText.h" 115 #include "core/rendering/RenderTreeAsText.h"
117 #include "core/rendering/RenderView.h" 116 #include "core/rendering/RenderView.h"
118 #include "core/testing/GCObservation.h" 117 #include "core/testing/GCObservation.h"
119 #include "core/workers/WorkerThread.h" 118 #include "core/workers/WorkerThread.h"
120 #include "modules/speech/DOMWindowSpeechSynthesis.h"
121 #include "modules/speech/SpeechSynthesis.h"
122 #include "platform/Language.h" 119 #include "platform/Language.h"
123 #include "platform/TraceEvent.h" 120 #include "platform/TraceEvent.h"
124 #include "platform/geometry/IntRect.h" 121 #include "platform/geometry/IntRect.h"
125 #include "public/platform/WebLayer.h" 122 #include "public/platform/WebLayer.h"
126 #include "weborigin/SchemeRegistry.h" 123 #include "weborigin/SchemeRegistry.h"
127 #include "wtf/dtoa.h" 124 #include "wtf/dtoa.h"
128 #include "wtf/text/StringBuffer.h" 125 #include "wtf/text/StringBuffer.h"
129 126
130 namespace WebCore { 127 namespace WebCore {
131 128
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 } 711 }
715 String uniqueName = frame()->tree().uniqueName(); 712 String uniqueName = frame()->tree().uniqueName();
716 if (mainItem->target() == uniqueName) 713 if (mainItem->target() == uniqueName)
717 mainItem->setDocumentState(state); 714 mainItem->setDocumentState(state);
718 else if (HistoryItem* subItem = mainItem->childItemWithTarget(uniqueName)) 715 else if (HistoryItem* subItem = mainItem->childItemWithTarget(uniqueName))
719 subItem->setDocumentState(state); 716 subItem->setDocumentState(state);
720 else 717 else
721 es.throwUninformativeAndGenericDOMException(InvalidAccessError); 718 es.throwUninformativeAndGenericDOMException(InvalidAccessError);
722 } 719 }
723 720
724 void Internals::enableMockSpeechSynthesizer()
725 {
726 Document* document = contextDocument();
727 if (!document || !document->domWindow())
728 return;
729 SpeechSynthesis* synthesis = DOMWindowSpeechSynthesis::speechSynthesis(docum ent->domWindow());
730 if (!synthesis)
731 return;
732
733 synthesis->setPlatformSynthesizer(PlatformSpeechSynthesizerMock::create(synt hesis));
734 }
735
736 void Internals::setEnableMockPagePopup(bool enabled, ExceptionState& es) 721 void Internals::setEnableMockPagePopup(bool enabled, ExceptionState& es)
737 { 722 {
738 Document* document = contextDocument(); 723 Document* document = contextDocument();
739 if (!document || !document->page()) 724 if (!document || !document->page())
740 return; 725 return;
741 Page* page = document->page(); 726 Page* page = document->page();
742 if (!enabled) { 727 if (!enabled) {
743 page->chrome().client().resetPagePopupDriver(); 728 page->chrome().client().resetPagePopupDriver();
744 return; 729 return;
745 } 730 }
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
2273 return false; 2258 return false;
2274 sharedContext->extensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEX T_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); 2259 sharedContext->extensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEX T_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
2275 // To prevent tests that call loseSharedGraphicsContext3D from being 2260 // To prevent tests that call loseSharedGraphicsContext3D from being
2276 // flaky, we call finish so that the context is guaranteed to be lost 2261 // flaky, we call finish so that the context is guaranteed to be lost
2277 // synchronously (i.e. before returning). 2262 // synchronously (i.e. before returning).
2278 sharedContext->finish(); 2263 sharedContext->finish();
2279 return true; 2264 return true;
2280 } 2265 }
2281 2266
2282 } 2267 }
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