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

Side by Side Diff: third_party/WebKit/Source/modules/speech/testing/PlatformSpeechSynthesizerMock.cpp

Issue 1861323003: Have the mock PlatformSpeechSynthesizer ignore pause/resume sometimes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-mock-no-crash-expected.txt ('k') | no next file » | 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) 2013 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2013 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 // Per spec, removes all queued utterances. 115 // Per spec, removes all queued utterances.
116 m_queuedUtterances.clear(); 116 m_queuedUtterances.clear();
117 117
118 m_speakingFinishedTimer.stop(); 118 m_speakingFinishedTimer.stop();
119 m_speakingErrorOccurredTimer.startOneShot(.1, BLINK_FROM_HERE); 119 m_speakingErrorOccurredTimer.startOneShot(.1, BLINK_FROM_HERE);
120 } 120 }
121 121
122 void PlatformSpeechSynthesizerMock::pause() 122 void PlatformSpeechSynthesizerMock::pause()
123 { 123 {
124 if (!m_currentUtterance)
125 return;
126
124 client()->didPauseSpeaking(m_currentUtterance); 127 client()->didPauseSpeaking(m_currentUtterance);
125 } 128 }
126 129
127 void PlatformSpeechSynthesizerMock::resume() 130 void PlatformSpeechSynthesizerMock::resume()
128 { 131 {
132 if (!m_currentUtterance)
133 return;
134
129 client()->didResumeSpeaking(m_currentUtterance); 135 client()->didResumeSpeaking(m_currentUtterance);
130 } 136 }
131 137
132 DEFINE_TRACE(PlatformSpeechSynthesizerMock) 138 DEFINE_TRACE(PlatformSpeechSynthesizerMock)
133 { 139 {
134 visitor->trace(m_currentUtterance); 140 visitor->trace(m_currentUtterance);
135 visitor->trace(m_queuedUtterances); 141 visitor->trace(m_queuedUtterances);
136 PlatformSpeechSynthesizer::trace(visitor); 142 PlatformSpeechSynthesizer::trace(visitor);
137 } 143 }
138 144
139 } // namespace blink 145 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/speechsynthesis/speech-synthesis-mock-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698