Commit 63aec358 authored by tfarina@chromium.org's avatar tfarina@chromium.org

test_runner: Move more Mock* files into content namespace.

BUG=331299
TEST=None, no functional changes. Green trybots.
TBR=jochen@chromium.org

Review URL: https://codereview.chromium.org/263823011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268066 0039d316-1c4b-4281-b951-d872f2087c98
parent 1ef99e7d
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
#include "content/shell/renderer/test_runner/TestCommon.h" #include "content/shell/renderer/test_runner/TestCommon.h"
#include "third_party/WebKit/public/platform/WebCString.h" #include "third_party/WebKit/public/platform/WebCString.h"
using namespace WebTestRunner;
using namespace blink; using namespace blink;
using namespace std; using namespace std;
namespace WebTestRunner { namespace content {
namespace { namespace {
...@@ -182,4 +183,4 @@ bool MockSpellCheck::initializeIfNeeded() ...@@ -182,4 +183,4 @@ bool MockSpellCheck::initializeIfNeeded()
return false; return false;
} }
} } // namespace content
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "third_party/WebKit/public/platform/WebVector.h" #include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebTextCheckingResult.h" #include "third_party/WebKit/public/web/WebTextCheckingResult.h"
namespace WebTestRunner { namespace content {
// A mock implementation of a spell-checker used for WebKit tests. // A mock implementation of a spell-checker used for WebKit tests.
// This class only implements the minimal functionarities required by WebKit // This class only implements the minimal functionarities required by WebKit
...@@ -64,6 +64,6 @@ private: ...@@ -64,6 +64,6 @@ private:
DISALLOW_COPY_AND_ASSIGN(MockSpellCheck); DISALLOW_COPY_AND_ASSIGN(MockSpellCheck);
}; };
} } // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKSPELLCHECK_H_ #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKSPELLCHECK_H_
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
#include "content/shell/renderer/test_runner/MockWebAudioDevice.h" #include "content/shell/renderer/test_runner/MockWebAudioDevice.h"
using namespace blink; namespace content {
namespace WebTestRunner {
MockWebAudioDevice::MockWebAudioDevice(double sampleRate) MockWebAudioDevice::MockWebAudioDevice(double sampleRate)
: m_sampleRate(sampleRate) : m_sampleRate(sampleRate)
...@@ -30,4 +28,4 @@ double MockWebAudioDevice::sampleRate() ...@@ -30,4 +28,4 @@ double MockWebAudioDevice::sampleRate()
return m_sampleRate; return m_sampleRate;
} }
} // namespace WebTestRunner } // namespace content
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "content/shell/renderer/test_runner/TestCommon.h" #include "content/shell/renderer/test_runner/TestCommon.h"
#include "third_party/WebKit/public/platform/WebAudioDevice.h" #include "third_party/WebKit/public/platform/WebAudioDevice.h"
namespace WebTestRunner { namespace content {
class MockWebAudioDevice : public blink::WebAudioDevice { class MockWebAudioDevice : public blink::WebAudioDevice {
public: public:
...@@ -26,6 +26,6 @@ private: ...@@ -26,6 +26,6 @@ private:
DISALLOW_COPY_AND_ASSIGN(MockWebAudioDevice); DISALLOW_COPY_AND_ASSIGN(MockWebAudioDevice);
}; };
} // namespace WebTestRunner } // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBAUDIODEVICE_H_ #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBAUDIODEVICE_H_
...@@ -11,13 +11,16 @@ ...@@ -11,13 +11,16 @@
#include "third_party/WebKit/public/platform/WebMIDIAccessorClient.h" #include "third_party/WebKit/public/platform/WebMIDIAccessorClient.h"
using namespace blink; using namespace blink;
using WebTestRunner::TestInterfaces;
namespace content {
namespace { namespace {
class DidStartSessionTask : public WebTestRunner::WebMethodTask<WebTestRunner::MockWebMIDIAccessor> { class DidStartSessionTask : public WebTestRunner::WebMethodTask<MockWebMIDIAccessor> {
public: public:
DidStartSessionTask(WebTestRunner::MockWebMIDIAccessor* object, blink::WebMIDIAccessorClient* client, bool result) DidStartSessionTask(MockWebMIDIAccessor* object, blink::WebMIDIAccessorClient* client, bool result)
: WebMethodTask<WebTestRunner::MockWebMIDIAccessor>(object) : WebMethodTask<MockWebMIDIAccessor>(object)
, m_client(client) , m_client(client)
, m_result(result) , m_result(result)
{ {
...@@ -33,9 +36,7 @@ private: ...@@ -33,9 +36,7 @@ private:
bool m_result; bool m_result;
}; };
} // namespace } // namespace
namespace WebTestRunner {
MockWebMIDIAccessor::MockWebMIDIAccessor(blink::WebMIDIAccessorClient* client, TestInterfaces* interfaces) MockWebMIDIAccessor::MockWebMIDIAccessor(blink::WebMIDIAccessorClient* client, TestInterfaces* interfaces)
: m_client(client) : m_client(client)
...@@ -55,4 +56,4 @@ void MockWebMIDIAccessor::startSession() ...@@ -55,4 +56,4 @@ void MockWebMIDIAccessor::startSession()
m_interfaces->delegate()->postTask(new DidStartSessionTask(this, m_client, m_interfaces->testRunner()->midiAccessorResult())); m_interfaces->delegate()->postTask(new DidStartSessionTask(this, m_client, m_interfaces->testRunner()->midiAccessorResult()));
} }
} // namespace WebTestRunner } // namespace content
...@@ -15,33 +15,34 @@ class WebMIDIAccessorClient; ...@@ -15,33 +15,34 @@ class WebMIDIAccessorClient;
} }
namespace WebTestRunner { namespace WebTestRunner {
class TestInterfaces; class TestInterfaces;
}
namespace content {
class MockWebMIDIAccessor : public blink::WebMIDIAccessor { class MockWebMIDIAccessor : public blink::WebMIDIAccessor {
public: public:
explicit MockWebMIDIAccessor(blink::WebMIDIAccessorClient*, TestInterfaces*); explicit MockWebMIDIAccessor(blink::WebMIDIAccessorClient*, WebTestRunner::TestInterfaces*);
virtual ~MockWebMIDIAccessor(); virtual ~MockWebMIDIAccessor();
// blink::WebMIDIAccessor implementation. // blink::WebMIDIAccessor implementation.
virtual void startSession() OVERRIDE; virtual void startSession() OVERRIDE;
virtual void sendMIDIData( virtual void sendMIDIData(unsigned portIndex,
unsigned portIndex, const unsigned char* data,
const unsigned char* data, size_t length,
size_t length, double timestamp) OVERRIDE {}
double timestamp) OVERRIDE { }
// WebTask related methods // WebTask related methods
WebTaskList* taskList() { return &m_taskList; } WebTestRunner::WebTaskList* taskList() { return &m_taskList; }
private: private:
blink::WebMIDIAccessorClient* m_client; blink::WebMIDIAccessorClient* m_client;
WebTaskList m_taskList; WebTestRunner::WebTaskList m_taskList;
TestInterfaces* m_interfaces; WebTestRunner::TestInterfaces* m_interfaces;
DISALLOW_COPY_AND_ASSIGN(MockWebMIDIAccessor); DISALLOW_COPY_AND_ASSIGN(MockWebMIDIAccessor);
}; };
} // namespace WebTestRunner } // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBMIDIACCESSOR_H_ #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBMIDIACCESSOR_H_
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
#include "third_party/WebKit/public/web/WebTextCheckingCompletion.h" #include "third_party/WebKit/public/web/WebTextCheckingCompletion.h"
#include "third_party/WebKit/public/web/WebTextCheckingResult.h" #include "third_party/WebKit/public/web/WebTextCheckingResult.h"
using namespace WebTestRunner;
using namespace blink; using namespace blink;
using namespace content;
using namespace std; using namespace std;
namespace WebTestRunner { namespace content {
namespace { namespace {
...@@ -141,4 +141,4 @@ WebString SpellCheckClient::autoCorrectWord(const WebString&) ...@@ -141,4 +141,4 @@ WebString SpellCheckClient::autoCorrectWord(const WebString&)
return WebString(); return WebString();
} }
} } // namespace content
...@@ -15,17 +15,19 @@ class WebTestProxyBase; ...@@ -15,17 +15,19 @@ class WebTestProxyBase;
} }
namespace WebTestRunner { namespace WebTestRunner {
class WebTestDelegate; class WebTestDelegate;
}
namespace content {
class SpellCheckClient : public blink::WebSpellCheckClient { class SpellCheckClient : public blink::WebSpellCheckClient {
public: public:
explicit SpellCheckClient(content::WebTestProxyBase*); explicit SpellCheckClient(content::WebTestProxyBase*);
virtual ~SpellCheckClient(); virtual ~SpellCheckClient();
void setDelegate(WebTestDelegate*); void setDelegate(WebTestRunner::WebTestDelegate*);
WebTaskList* taskList() { return &m_taskList; } WebTestRunner::WebTaskList* taskList() { return &m_taskList; }
MockSpellCheck* mockSpellCheck() { return &m_spellcheck; } MockSpellCheck* mockSpellCheck() { return &m_spellcheck; }
// blink::WebSpellCheckClient implementation. // blink::WebSpellCheckClient implementation.
...@@ -46,15 +48,15 @@ private: ...@@ -46,15 +48,15 @@ private:
blink::WebString m_lastRequestedTextCheckString; blink::WebString m_lastRequestedTextCheckString;
blink::WebTextCheckingCompletion* m_lastRequestedTextCheckingCompletion; blink::WebTextCheckingCompletion* m_lastRequestedTextCheckingCompletion;
WebTaskList m_taskList; WebTestRunner::WebTaskList m_taskList;
WebTestDelegate* m_delegate; WebTestRunner::WebTestDelegate* m_delegate;
content::WebTestProxyBase* m_webTestProxy; content::WebTestProxyBase* m_webTestProxy;
DISALLOW_COPY_AND_ASSIGN(SpellCheckClient); DISALLOW_COPY_AND_ASSIGN(SpellCheckClient);
}; };
} } // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_ #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_
...@@ -73,7 +73,6 @@ typedef unsigned WebColor; ...@@ -73,7 +73,6 @@ typedef unsigned WebColor;
namespace WebTestRunner { namespace WebTestRunner {
class MockWebSpeechRecognizer; class MockWebSpeechRecognizer;
class SpellCheckClient;
class TestInterfaces; class TestInterfaces;
class WebTestDelegate; class WebTestDelegate;
class WebTestInterfaces; class WebTestInterfaces;
...@@ -83,6 +82,7 @@ class WebUserMediaClientMock; ...@@ -83,6 +82,7 @@ class WebUserMediaClientMock;
namespace content { namespace content {
class RenderFrame; class RenderFrame;
class SpellCheckClient;
class WebTestProxyBase : public blink::WebCompositeAndReadbackAsyncCallback { class WebTestProxyBase : public blink::WebCompositeAndReadbackAsyncCallback {
public: public:
...@@ -207,7 +207,7 @@ private: ...@@ -207,7 +207,7 @@ private:
WebTestRunner::WebTaskList m_taskList; WebTestRunner::WebTaskList m_taskList;
scoped_ptr<WebTestRunner::SpellCheckClient> m_spellcheck; scoped_ptr<SpellCheckClient> m_spellcheck;
scoped_ptr<WebTestRunner::WebUserMediaClientMock> m_userMediaClient; scoped_ptr<WebTestRunner::WebUserMediaClientMock> m_userMediaClient;
// Painting. // Painting.
......
...@@ -177,7 +177,7 @@ std::vector<std::string> MakeMenuItemStringsFor( ...@@ -177,7 +177,7 @@ std::vector<std::string> MakeMenuItemStringsFor(
strings.push_back(*item); strings.push_back(*item);
} }
WebVector<WebString> suggestions; WebVector<WebString> suggestions;
WebTestRunner::MockSpellCheck::fillSuggestionList( MockSpellCheck::fillSuggestionList(
context_menu->misspelledWord, &suggestions); context_menu->misspelledWord, &suggestions);
for (size_t i = 0; i < suggestions.size(); ++i) { for (size_t i = 0; i < suggestions.size(); ++i) {
strings.push_back(suggestions[i].utf8()); strings.push_back(suggestions[i].utf8());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment