Index: components/web_restrictions/browser/mock_web_restrictions_client.cc |
diff --git a/components/web_restrictions/browser/mock_web_restrictions_client.cc b/components/web_restrictions/browser/mock_web_restrictions_client.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..acc849cc3e0bdb82ad93262e2b69484bb909f81b |
--- /dev/null |
+++ b/components/web_restrictions/browser/mock_web_restrictions_client.cc |
@@ -0,0 +1,26 @@ |
+// Copyright 2016 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. |
+ |
+#include "components/web_restrictions/browser/mock_web_restrictions_client.h" |
+ |
+#include "jni/MockWebRestrictionsClient_jni.h" |
+ |
+namespace web_restrictions { |
+ |
+MockWebRestrictionsClient::MockWebRestrictionsClient() { |
+ Java_MockWebRestrictionsClient_registerAsMockForTesting( |
+ base::android::AttachCurrentThread()); |
+} |
+ |
+MockWebRestrictionsClient::~MockWebRestrictionsClient() { |
+ Java_MockWebRestrictionsClient_unregisterAsMockForTesting( |
+ base::android::AttachCurrentThread()); |
+} |
+ |
+bool MockWebRestrictionsClient::Register(JNIEnv* env) { |
+ return RegisterNativesImpl(env); |
+} |
+ |
+} // namespace web_restrictions |
+ |