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

Unified Diff: content/browser/service_worker/service_worker_test_utils.h

Issue 2396273002: ServiceWorker: Mojofication of ServiceWorkerDispatcherHost (Closed)
Patch Set: Removed GetWeakPtr and moved a method to private Created 4 years, 2 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/browser/service_worker/service_worker_test_utils.h
diff --git a/content/browser/service_worker/service_worker_test_utils.h b/content/browser/service_worker/service_worker_test_utils.h
index 9e3983baa59ff5e0f5350993578b8aa1717af0c1..2a15815c30b017a43805ae000b196660d52b26ab 100644
--- a/content/browser/service_worker/service_worker_test_utils.h
+++ b/content/browser/service_worker/service_worker_test_utils.h
@@ -7,10 +7,32 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/command_line.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/content_switches.h"
+#include "testing/gtest/include/gtest/gtest.h"
namespace content {
+template <class TestClass>
+class MojoServiceWorkerTestP : public TestClass,
+ public testing::WithParamInterface<bool> {
+ protected:
+ void SetUp() override {
+ is_mojo_enabled_ = GetParam();
+ if (is_mojo_enabled()) {
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kMojoServiceWorker);
+ }
+ TestClass::SetUp();
+ }
+
+ bool is_mojo_enabled() const { return is_mojo_enabled_; }
+
+ private:
+ bool is_mojo_enabled_ = false;
+};
+
template <typename Arg>
void ReceiveResult(BrowserThread::ID run_quit_thread,
const base::Closure& quit,

Powered by Google App Engine
This is Rietveld 408576698