Index: third_party/WebKit/Source/platform/testing/MojoTestHelper.h |
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8Regex.h b/third_party/WebKit/Source/platform/testing/MojoTestHelper.h |
similarity index 30% |
copy from third_party/WebKit/Source/platform/v8_inspector/V8Regex.h |
copy to third_party/WebKit/Source/platform/testing/MojoTestHelper.h |
index 2e8680434a42be07c93dcc3e3225ebd10bf6d9e7..0ea91b1bca662969fc60186cf08096260d7bfea6 100644 |
--- a/third_party/WebKit/Source/platform/v8_inspector/V8Regex.h |
+++ b/third_party/WebKit/Source/platform/testing/MojoTestHelper.h |
@@ -2,35 +2,31 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef V8Regex_h |
-#define V8Regex_h |
+#ifndef MojoTestHelper_h |
+#define MojoTestHelper_h |
+#include "base/message_loop/message_loop.h" |
#include "wtf/Noncopyable.h" |
-#include "wtf/text/WTFString.h" |
-#include <v8.h> |
namespace blink { |
-class V8DebuggerImpl; |
- |
-enum MultilineMode { |
- MultilineDisabled, |
- MultilineEnabled |
-}; |
- |
-class V8Regex { |
- USING_FAST_MALLOC(V8Regex); |
- WTF_MAKE_NONCOPYABLE(V8Regex); |
+// Provides common utilities to help writing unittests based on Mojo services. |
+// |
+// Expected usage is: |
+// class YourUnittest : public ::testing::Test { |
+// private: |
+// MojoTestHelper mojo_test_helper_; |
esprehn
2016/02/18 06:48:13
This doesn't seem good, it just adds a message loo
Yuki
2016/02/18 07:20:35
Then, we're going to introduce this header file ju
|
+// }; |
+class MojoTestHelper final { |
+ WTF_MAKE_NONCOPYABLE(MojoTestHelper); |
public: |
- V8Regex(V8DebuggerImpl*, const String&, TextCaseSensitivity, MultilineMode = MultilineDisabled); |
- int match(const String&, int startFrom = 0, int* matchLength = 0) const; |
- bool isValid() const { return !m_regex.IsEmpty(); } |
+ MojoTestHelper() = default; |
+ ~MojoTestHelper() = default; |
private: |
- V8DebuggerImpl* m_debugger; |
- v8::Global<v8::RegExp> m_regex; |
+ base::MessageLoop m_messageLoop; // Mojo needs a message loop running. |
}; |
} // namespace blink |
-#endif // V8Regex_h |
+#endif // MojoTestHelper_h |