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 @@
#include "content/shell/renderer/test_runner/TestCommon.h"
#include "third_party/WebKit/public/platform/WebCString.h"
using namespace WebTestRunner;
using namespace blink;
using namespace std;
namespace WebTestRunner {
namespace content {
namespace {
......@@ -182,4 +183,4 @@ bool MockSpellCheck::initializeIfNeeded()
return false;
}
}
} // namespace content
......@@ -12,7 +12,7 @@
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebTextCheckingResult.h"
namespace WebTestRunner {
namespace content {
// A mock implementation of a spell-checker used for WebKit tests.
// This class only implements the minimal functionarities required by WebKit
......@@ -64,6 +64,6 @@ private:
DISALLOW_COPY_AND_ASSIGN(MockSpellCheck);
};
}
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKSPELLCHECK_H_
......@@ -4,9 +4,7 @@
#include "content/shell/renderer/test_runner/MockWebAudioDevice.h"
using namespace blink;
namespace WebTestRunner {
namespace content {
MockWebAudioDevice::MockWebAudioDevice(double sampleRate)
: m_sampleRate(sampleRate)
......@@ -30,4 +28,4 @@ double MockWebAudioDevice::sampleRate()
return m_sampleRate;
}
} // namespace WebTestRunner
} // namespace content
......@@ -9,7 +9,7 @@
#include "content/shell/renderer/test_runner/TestCommon.h"
#include "third_party/WebKit/public/platform/WebAudioDevice.h"
namespace WebTestRunner {
namespace content {
class MockWebAudioDevice : public blink::WebAudioDevice {
public:
......@@ -26,6 +26,6 @@ private:
DISALLOW_COPY_AND_ASSIGN(MockWebAudioDevice);
};
} // namespace WebTestRunner
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBAUDIODEVICE_H_
......@@ -11,13 +11,16 @@
#include "third_party/WebKit/public/platform/WebMIDIAccessorClient.h"
using namespace blink;
using WebTestRunner::TestInterfaces;
namespace content {
namespace {
class DidStartSessionTask : public WebTestRunner::WebMethodTask<WebTestRunner::MockWebMIDIAccessor> {
class DidStartSessionTask : public WebTestRunner::WebMethodTask<MockWebMIDIAccessor> {
public:
DidStartSessionTask(WebTestRunner::MockWebMIDIAccessor* object, blink::WebMIDIAccessorClient* client, bool result)
: WebMethodTask<WebTestRunner::MockWebMIDIAccessor>(object)
DidStartSessionTask(MockWebMIDIAccessor* object, blink::WebMIDIAccessorClient* client, bool result)
: WebMethodTask<MockWebMIDIAccessor>(object)
, m_client(client)
, m_result(result)
{
......@@ -35,8 +38,6 @@ private:
} // namespace
namespace WebTestRunner {
MockWebMIDIAccessor::MockWebMIDIAccessor(blink::WebMIDIAccessorClient* client, TestInterfaces* interfaces)
: m_client(client)
, m_interfaces(interfaces)
......@@ -55,4 +56,4 @@ void MockWebMIDIAccessor::startSession()
m_interfaces->delegate()->postTask(new DidStartSessionTask(this, m_client, m_interfaces->testRunner()->midiAccessorResult()));
}
} // namespace WebTestRunner
} // namespace content
......@@ -15,33 +15,34 @@ class WebMIDIAccessorClient;
}
namespace WebTestRunner {
class TestInterfaces;
}
namespace content {
class MockWebMIDIAccessor : public blink::WebMIDIAccessor {
public:
explicit MockWebMIDIAccessor(blink::WebMIDIAccessorClient*, TestInterfaces*);
explicit MockWebMIDIAccessor(blink::WebMIDIAccessorClient*, WebTestRunner::TestInterfaces*);
virtual ~MockWebMIDIAccessor();
// blink::WebMIDIAccessor implementation.
virtual void startSession() OVERRIDE;
virtual void sendMIDIData(
unsigned portIndex,
virtual void sendMIDIData(unsigned portIndex,
const unsigned char* data,
size_t length,
double timestamp) OVERRIDE { }
double timestamp) OVERRIDE {}
// WebTask related methods
WebTaskList* taskList() { return &m_taskList; }
WebTestRunner::WebTaskList* taskList() { return &m_taskList; }
private:
blink::WebMIDIAccessorClient* m_client;
WebTaskList m_taskList;
TestInterfaces* m_interfaces;
WebTestRunner::WebTaskList m_taskList;
WebTestRunner::TestInterfaces* m_interfaces;
DISALLOW_COPY_AND_ASSIGN(MockWebMIDIAccessor);
};
} // namespace WebTestRunner
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBMIDIACCESSOR_H_
......@@ -10,11 +10,11 @@
#include "third_party/WebKit/public/web/WebTextCheckingCompletion.h"
#include "third_party/WebKit/public/web/WebTextCheckingResult.h"
using namespace WebTestRunner;
using namespace blink;
using namespace content;
using namespace std;
namespace WebTestRunner {
namespace content {
namespace {
......@@ -141,4 +141,4 @@ WebString SpellCheckClient::autoCorrectWord(const WebString&)
return WebString();
}
}
} // namespace content
......@@ -15,17 +15,19 @@ class WebTestProxyBase;
}
namespace WebTestRunner {
class WebTestDelegate;
}
namespace content {
class SpellCheckClient : public blink::WebSpellCheckClient {
public:
explicit SpellCheckClient(content::WebTestProxyBase*);
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; }
// blink::WebSpellCheckClient implementation.
......@@ -46,15 +48,15 @@ private:
blink::WebString m_lastRequestedTextCheckString;
blink::WebTextCheckingCompletion* m_lastRequestedTextCheckingCompletion;
WebTaskList m_taskList;
WebTestRunner::WebTaskList m_taskList;
WebTestDelegate* m_delegate;
WebTestRunner::WebTestDelegate* m_delegate;
content::WebTestProxyBase* m_webTestProxy;
DISALLOW_COPY_AND_ASSIGN(SpellCheckClient);
};
}
} // namespace content
#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_SPELLCHECKCLIENT_H_
......@@ -73,7 +73,6 @@ typedef unsigned WebColor;
namespace WebTestRunner {
class MockWebSpeechRecognizer;
class SpellCheckClient;
class TestInterfaces;
class WebTestDelegate;
class WebTestInterfaces;
......@@ -83,6 +82,7 @@ class WebUserMediaClientMock;
namespace content {
class RenderFrame;
class SpellCheckClient;
class WebTestProxyBase : public blink::WebCompositeAndReadbackAsyncCallback {
public:
......@@ -207,7 +207,7 @@ private:
WebTestRunner::WebTaskList m_taskList;
scoped_ptr<WebTestRunner::SpellCheckClient> m_spellcheck;
scoped_ptr<SpellCheckClient> m_spellcheck;
scoped_ptr<WebTestRunner::WebUserMediaClientMock> m_userMediaClient;
// Painting.
......
......@@ -177,7 +177,7 @@ std::vector<std::string> MakeMenuItemStringsFor(
strings.push_back(*item);
}
WebVector<WebString> suggestions;
WebTestRunner::MockSpellCheck::fillSuggestionList(
MockSpellCheck::fillSuggestionList(
context_menu->misspelledWord, &suggestions);
for (size_t i = 0; i < suggestions.size(); ++i) {
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