CustomHandler: Remove testing folder in navigatorcontentutils
The testing folder was to test *isRegisterProtocolHandler* mainly. But, the function
was removed from the spec. And also, the implementation was removed as well. So, this CL
removes testing folder for now. But, we can restore the folder if isProtocolHandlerRegistered
can be implemented in blink.
Bug: 121825
Change-Id: Ia3ff296ddf93adbf0ac39362c31d83de9d995113
Reviewed-on: https://chromium-review.googlesource.com/c/1391040
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#619059}diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn
index b91df7ab7..de2bfac 100644
--- a/third_party/blink/renderer/modules/BUILD.gn
+++ b/third_party/blink/renderer/modules/BUILD.gn
@@ -189,10 +189,6 @@
"accessibility/testing/internals_accessibility.h",
"mediastream/testing/internals_media_stream.cc",
"mediastream/testing/internals_media_stream.h",
- "navigatorcontentutils/testing/internals_navigator_content_utils.cc",
- "navigatorcontentutils/testing/internals_navigator_content_utils.h",
- "navigatorcontentutils/testing/navigator_content_utils_client_mock.cc",
- "navigatorcontentutils/testing/navigator_content_utils_client_mock.h",
"peerconnection/adapters/test/mock_ice_transport_adapter.h",
"peerconnection/adapters/test/mock_ice_transport_adapter_cross_thread_factory.h",
"peerconnection/adapters/test/mock_p2p_quic_packet_transport.h",
diff --git a/third_party/blink/renderer/modules/modules_idl_files.gni b/third_party/blink/renderer/modules/modules_idl_files.gni
index 6ac635e..e88b2985 100644
--- a/third_party/blink/renderer/modules/modules_idl_files.gni
+++ b/third_party/blink/renderer/modules/modules_idl_files.gni
@@ -859,7 +859,6 @@
[
"accessibility/testing/internals_accessibility.idl",
"mediastream/testing/internals_media_stream.idl",
- "navigatorcontentutils/testing/internals_navigator_content_utils.idl",
"peerconnection/testing/internals_rtc_certificate.idl",
"peerconnection/testing/internals_rtc_peer_connection.idl",
"service_worker/testing/internals_service_worker.idl",
diff --git a/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.cc b/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.cc
deleted file mode 100644
index 7c76008..0000000
--- a/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2014 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 "third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.h"
-
-#include "third_party/blink/renderer/core/dom/document.h"
-#include "third_party/blink/renderer/core/frame/local_dom_window.h"
-#include "third_party/blink/renderer/core/testing/internals.h"
-#include "third_party/blink/renderer/modules/navigatorcontentutils/navigator_content_utils.h"
-#include "third_party/blink/renderer/modules/navigatorcontentutils/testing/navigator_content_utils_client_mock.h"
-
-namespace blink {
-
-void InternalsNavigatorContentUtils::setNavigatorContentUtilsClientMock(
- Internals&,
- Document* document) {
- DCHECK(document);
- DCHECK(document->GetPage());
- NavigatorContentUtils* navigator_content_utils =
- NavigatorContentUtils::From(*document->domWindow()->navigator());
- navigator_content_utils->SetClientForTest(
- NavigatorContentUtilsClientMock::Create());
-}
-
-} // namespace blink
diff --git a/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.h b/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.h
deleted file mode 100644
index 598fb461..0000000
--- a/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_NAVIGATORCONTENTUTILS_TESTING_INTERNALS_NAVIGATOR_CONTENT_UTILS_H_
-#define THIRD_PARTY_BLINK_RENDERER_MODULES_NAVIGATORCONTENTUTILS_TESTING_INTERNALS_NAVIGATOR_CONTENT_UTILS_H_
-
-#include "third_party/blink/renderer/platform/wtf/allocator.h"
-
-namespace blink {
-
-class Document;
-class Internals;
-
-class InternalsNavigatorContentUtils {
- STATIC_ONLY(InternalsNavigatorContentUtils);
-
- public:
- static void setNavigatorContentUtilsClientMock(Internals&, Document*);
-};
-
-} // namespace blink
-
-#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_NAVIGATORCONTENTUTILS_TESTING_INTERNALS_NAVIGATOR_CONTENT_UTILS_H_
diff --git a/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.idl b/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.idl
deleted file mode 100644
index a8430ed..0000000
--- a/third_party/blink/renderer/modules/navigatorcontentutils/testing/internals_navigator_content_utils.idl
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2014 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.
-
-[
- ImplementedAs=InternalsNavigatorContentUtils
-] partial interface Internals {
- void setNavigatorContentUtilsClientMock(Document document);
-};
diff --git a/third_party/blink/renderer/modules/navigatorcontentutils/testing/navigator_content_utils_client_mock.cc b/third_party/blink/renderer/modules/navigatorcontentutils/testing/navigator_content_utils_client_mock.cc
deleted file mode 100644
index aaa7e14..0000000
--- a/third_party/blink/renderer/modules/navigatorcontentutils/testing/navigator_content_utils_client_mock.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2014 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 "third_party/blink/renderer/modules/navigatorcontentutils/testing/navigator_content_utils_client_mock.h"
-
-#include "third_party/blink/renderer/modules/navigatorcontentutils/navigator_content_utils_client.h"
-#include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
-
-namespace blink {
-
-void NavigatorContentUtilsClientMock::RegisterProtocolHandler(
- const String& scheme,
- const KURL& url,
- const String& title) {
- ProtocolInfo info;
- info.scheme = scheme;
- info.url = url;
- info.title = title;
-
- protocol_map_.Set(scheme, info);
-}
-
-void NavigatorContentUtilsClientMock::UnregisterProtocolHandler(
- const String& scheme,
- const KURL& url) {
- protocol_map_.erase(scheme);
-}
-
-} // namespace blink
diff --git a/third_party/blink/renderer/modules/navigatorcontentutils/testing/navigator_content_utils_client_mock.h b/third_party/blink/renderer/modules/navigatorcontentutils/testing/navigator_content_utils_client_mock.h
deleted file mode 100644
index bbdb43d..0000000
--- a/third_party/blink/renderer/modules/navigatorcontentutils/testing/navigator_content_utils_client_mock.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2014 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.
-
-#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_NAVIGATORCONTENTUTILS_TESTING_NAVIGATOR_CONTENT_UTILS_CLIENT_MOCK_H_
-#define THIRD_PARTY_BLINK_RENDERER_MODULES_NAVIGATORCONTENTUTILS_TESTING_NAVIGATOR_CONTENT_UTILS_CLIENT_MOCK_H_
-
-#include "third_party/blink/renderer/modules/navigatorcontentutils/navigator_content_utils_client.h"
-#include "third_party/blink/renderer/platform/heap/handle.h"
-#include "third_party/blink/renderer/platform/weborigin/kurl.h"
-#include "third_party/blink/renderer/platform/wtf/hash_set.h"
-#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
-
-namespace blink {
-
-// Provides a mock object for the navigatorcontentutils client.
-class NavigatorContentUtilsClientMock final
- : public NavigatorContentUtilsClient {
- public:
- static NavigatorContentUtilsClientMock* Create() {
- return MakeGarbageCollected<NavigatorContentUtilsClientMock>();
- }
-
- // TODO(sashab): Make NavigatorContentUtilsClientMock non-virtual and test it
- // using a WebLocalFrameClient mock.
- NavigatorContentUtilsClientMock() : NavigatorContentUtilsClient(nullptr) {}
- ~NavigatorContentUtilsClientMock() override = default;
-
- void RegisterProtocolHandler(const String& scheme,
- const KURL&,
- const String& title) override;
-
- void UnregisterProtocolHandler(const String& scheme, const KURL&) override;
-
- private:
- typedef struct {
- String scheme;
- KURL url;
- String title;
- } ProtocolInfo;
-
- typedef HashMap<String, ProtocolInfo> RegisteredProtocolMap;
- RegisteredProtocolMap protocol_map_;
-};
-
-} // namespace blink
-
-#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_NAVIGATORCONTENTUTILS_TESTING_NAVIGATOR_CONTENT_UTILS_CLIENT_MOCK_H_