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

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

Issue 189833009: Trace where timers were scheduled in Blink (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 9 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) 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 { 78 {
79 ASSERT(!m_utterance); 79 ASSERT(!m_utterance);
80 m_utterance = utterance; 80 m_utterance = utterance;
81 client()->didStartSpeaking(m_utterance); 81 client()->didStartSpeaking(m_utterance);
82 82
83 // Fire a fake word and then sentence boundary event. 83 // Fire a fake word and then sentence boundary event.
84 client()->boundaryEventOccurred(m_utterance, SpeechWordBoundary, 0); 84 client()->boundaryEventOccurred(m_utterance, SpeechWordBoundary, 0);
85 client()->boundaryEventOccurred(m_utterance, SpeechSentenceBoundary, m_utter ance->text().length()); 85 client()->boundaryEventOccurred(m_utterance, SpeechSentenceBoundary, m_utter ance->text().length());
86 86
87 // Give the fake speech job some time so that pause and other functions have time to be called. 87 // Give the fake speech job some time so that pause and other functions have time to be called.
88 m_speakingFinishedTimer.startOneShot(.1); 88 m_speakingFinishedTimer.startOneShot(.1, FROM_HERE);
89 } 89 }
90 90
91 void PlatformSpeechSynthesizerMock::cancel() 91 void PlatformSpeechSynthesizerMock::cancel()
92 { 92 {
93 if (!m_utterance) 93 if (!m_utterance)
94 return; 94 return;
95 95
96 m_speakingFinishedTimer.stop(); 96 m_speakingFinishedTimer.stop();
97 m_speakingErrorOccurredTimer.startOneShot(.1); 97 m_speakingErrorOccurredTimer.startOneShot(.1, FROM_HERE);
98 } 98 }
99 99
100 void PlatformSpeechSynthesizerMock::pause() 100 void PlatformSpeechSynthesizerMock::pause()
101 { 101 {
102 client()->didPauseSpeaking(m_utterance); 102 client()->didPauseSpeaking(m_utterance);
103 } 103 }
104 104
105 void PlatformSpeechSynthesizerMock::resume() 105 void PlatformSpeechSynthesizerMock::resume()
106 { 106 {
107 client()->didResumeSpeaking(m_utterance); 107 client()->didResumeSpeaking(m_utterance);
108 } 108 }
109 109
110 110
111 } // namespace WebCore 111 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientation.cpp ('k') | Source/modules/vibration/NavigatorVibration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698