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

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

Issue 1167703002: Move test runner to a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 7 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
Index: content/shell/renderer/test_runner/mock_web_speech_recognizer.h
diff --git a/content/shell/renderer/test_runner/mock_web_speech_recognizer.h b/content/shell/renderer/test_runner/mock_web_speech_recognizer.h
deleted file mode 100644
index a3733ff118fce1db5ac36ba122111a1b7dabcc35..0000000000000000000000000000000000000000
--- a/content/shell/renderer/test_runner/mock_web_speech_recognizer.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright 2014 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_MOCK_WEB_SPEECH_RECOGNIZER_H_
-#define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_
-
-#include <deque>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "content/shell/renderer/test_runner/web_task.h"
-#include "third_party/WebKit/public/web/WebSpeechRecognizer.h"
-
-namespace blink {
-class WebSpeechRecognitionHandle;
-class WebSpeechRecognitionParams;
-class WebSpeechRecognizerClient;
-class WebString;
-}
-
-namespace content {
-
-class WebTestDelegate;
-
-class MockWebSpeechRecognizer : public blink::WebSpeechRecognizer {
- public:
- MockWebSpeechRecognizer();
- virtual ~MockWebSpeechRecognizer();
-
- void SetDelegate(WebTestDelegate* delegate);
-
- // WebSpeechRecognizer implementation:
- virtual void start(const blink::WebSpeechRecognitionHandle& handle,
- const blink::WebSpeechRecognitionParams& params,
- blink::WebSpeechRecognizerClient* client);
- virtual void stop(const blink::WebSpeechRecognitionHandle& handle,
- blink::WebSpeechRecognizerClient* client);
- virtual void abort(const blink::WebSpeechRecognitionHandle& handle,
- blink::WebSpeechRecognizerClient* client);
-
- // 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 was_aborted_; }
-
- // Methods accessed from Task objects:
- blink::WebSpeechRecognizerClient* Client() { return client_; }
- blink::WebSpeechRecognitionHandle& Handle() { return handle_; }
- WebTaskList* mutable_task_list() { return &task_list_; }
-
- class Task {
- public:
- Task(MockWebSpeechRecognizer* recognizer) : recognizer_(recognizer) {}
- virtual ~Task() {}
- virtual void run() = 0;
-
- protected:
- MockWebSpeechRecognizer* recognizer_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Task);
- };
-
- private:
- void StartTaskQueue();
- void ClearTaskQueue();
-
- WebTaskList task_list_;
- blink::WebSpeechRecognitionHandle handle_;
- blink::WebSpeechRecognizerClient* client_;
- std::vector<blink::WebString> mock_transcripts_;
- std::vector<float> mock_confidences_;
- bool was_aborted_;
-
- // Queue of tasks to be run.
- std::deque<Task*> task_queue_;
- bool task_queue_running_;
-
- WebTestDelegate* delegate_;
-
- // Task for stepping the queue.
- class StepTask : public WebMethodTask<MockWebSpeechRecognizer> {
- public:
- StepTask(MockWebSpeechRecognizer* object)
- : WebMethodTask<MockWebSpeechRecognizer>(object) {}
- void RunIfValid() override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(StepTask);
- };
-
- DISALLOW_COPY_AND_ASSIGN(MockWebSpeechRecognizer);
-};
-
-} // namespace content
-
-#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCK_WEB_SPEECH_RECOGNIZER_H_

Powered by Google App Engine
This is Rietveld 408576698