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

Unified Diff: content/shell/renderer/test_runner/MockWebSpeechRecognizer.h

Issue 429953002: test_runner: Migrate MockWebSpeechRecognizer to Chromium C++ style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/BUILD.gn ('k') | content/shell/renderer/test_runner/MockWebSpeechRecognizer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/MockWebSpeechRecognizer.h
diff --git a/content/shell/renderer/test_runner/MockWebSpeechRecognizer.h b/content/shell/renderer/test_runner/MockWebSpeechRecognizer.h
deleted file mode 100644
index df248efa7625e0693e1baeeacc9cd873bb01938d..0000000000000000000000000000000000000000
--- a/content/shell/renderer/test_runner/MockWebSpeechRecognizer.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBSPEECHRECOGNIZER_H_
-#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBSPEECHRECOGNIZER_H_
-
-#include <deque>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "content/shell/renderer/test_runner/TestCommon.h"
-#include "content/shell/renderer/test_runner/WebTask.h"
-#include "third_party/WebKit/public/web/WebSpeechRecognizer.h"
-
-namespace blink {
-class WebSpeechRecognitionHandle;
-class WebSpeechRecognitionParams;
-class WebSpeechRecognizerClient;
-}
-
-namespace content {
-
-class WebTestDelegate;
-
-class MockWebSpeechRecognizer : public blink::WebSpeechRecognizer {
-public:
- MockWebSpeechRecognizer();
- virtual ~MockWebSpeechRecognizer();
-
- void setDelegate(WebTestDelegate*);
-
- // WebSpeechRecognizer implementation:
- virtual void start(const blink::WebSpeechRecognitionHandle&, const blink::WebSpeechRecognitionParams&, blink::WebSpeechRecognizerClient*) OVERRIDE;
- virtual void stop(const blink::WebSpeechRecognitionHandle&, blink::WebSpeechRecognizerClient*) OVERRIDE;
- virtual void abort(const blink::WebSpeechRecognitionHandle&, blink::WebSpeechRecognizerClient*) OVERRIDE;
-
- // Methods accessed by layout tests:
- void addMockResult(const blink::WebString& transcript, float confidence);
- void setError(const blink::WebString& error, const blink::WebString& message);
- bool wasAborted() const { return m_wasAborted; }
-
- // Methods accessed from Task objects:
- blink::WebSpeechRecognizerClient* client() { return m_client; }
- blink::WebSpeechRecognitionHandle& handle() { return m_handle; }
- WebTaskList* mutable_task_list() { return &m_taskList; }
-
- class Task {
- public:
- Task(MockWebSpeechRecognizer* recognizer) : m_recognizer(recognizer) { }
- virtual ~Task() { }
- virtual void run() = 0;
- protected:
- MockWebSpeechRecognizer* m_recognizer;
- };
-
-private:
- void startTaskQueue();
- void clearTaskQueue();
-
- WebTaskList m_taskList;
- blink::WebSpeechRecognitionHandle m_handle;
- blink::WebSpeechRecognizerClient* m_client;
- std::vector<blink::WebString> m_mockTranscripts;
- std::vector<float> m_mockConfidences;
- bool m_wasAborted;
-
- // Queue of tasks to be run.
- std::deque<Task*> m_taskQueue;
- bool m_taskQueueRunning;
-
- WebTestDelegate* m_delegate;
-
- // Task for stepping the queue.
- class StepTask : public WebMethodTask<MockWebSpeechRecognizer> {
- public:
- StepTask(MockWebSpeechRecognizer* object) : WebMethodTask<MockWebSpeechRecognizer>(object) { }
- virtual void runIfValid() OVERRIDE;
- };
-
- DISALLOW_COPY_AND_ASSIGN(MockWebSpeechRecognizer);
-};
-
-} // namespace content
-
-#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBSPEECHRECOGNIZER_H_
« no previous file with comments | « content/shell/BUILD.gn ('k') | content/shell/renderer/test_runner/MockWebSpeechRecognizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698