Skip to content

Commit

Permalink
Move NetworkInterceptor to main devtools package
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Sep 22, 2021
1 parent ece979a commit 5a6504a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 43 deletions.
1 change: 1 addition & 0 deletions java/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ v4.0.0-rc-2
===========

* Supported CDP versions: 85, 92, 93
* Moved NetworkInterceptor to org.opeqa.selenium.devtools
* NetworkInterceptor now takes a Filter to allow responses to be
captured and rewritten.
* Added a "relay" option to better support forwarding sessions to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.support.devtools;
package org.openqa.selenium.devtools;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.devtools.DevTools;
Expand Down Expand Up @@ -57,6 +57,10 @@
*/
public class NetworkInterceptor implements AutoCloseable {

/**
* Return this from a {@link Routable} in order to have the browser
* continue the request unmodified.
*/
public static final HttpResponse PROCEED_WITH_REQUEST = new HttpResponse()
.addHeader("Selenium-Interceptor", "Continue")
.setContent(utf8String("Original request should proceed"));
Expand Down
1 change: 0 additions & 1 deletion java/src/org/openqa/selenium/support/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ java_export(
visibility = ["//visibility:public"],
exports = [
":page-factory",
"//java/src/org/openqa/selenium/support/devtools",
"//java/src/org/openqa/selenium/support/events",
"//java/src/org/openqa/selenium/support/locators",
"//java/src/org/openqa/selenium/support/ui:clock",
Expand Down
16 changes: 0 additions & 16 deletions java/src/org/openqa/selenium/support/devtools/BUILD.bazel

This file was deleted.

3 changes: 2 additions & 1 deletion java/test/org/openqa/selenium/devtools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ java_selenium_test_suite(
deps = [
":test-lib",
"//java/src/org/openqa/selenium/devtools",
"//java/src/org/openqa/selenium/grid/security",
"//java/src/org/openqa/selenium/json",
"//java/src/org/openqa/selenium/remote",
"//java/src/org/openqa/selenium/support",
"//java/test/org/openqa/selenium/environment",
"//java/test/org/openqa/selenium/testing:annotations",
"//java/test/org/openqa/selenium/testing:test-base",
"//java/src/org/openqa/selenium/grid/security",
"//java/test/org/openqa/selenium/testing/drivers",
artifact("com.google.guava:guava"),
artifact("junit:junit"),
artifact("org.assertj:assertj-core"),
Expand Down
1 change: 0 additions & 1 deletion java/test/org/openqa/selenium/devtools/CdpFacadeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.openqa.selenium.remote.http.Contents;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.http.Route;
import org.openqa.selenium.support.devtools.NetworkInterceptor;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.drivers.Browser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package org.openqa.selenium.support.devtools;
package org.openqa.selenium.devtools;

import com.google.common.net.MediaType;
import org.junit.After;
Expand All @@ -25,6 +25,7 @@
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.devtools.HasDevTools;
import org.openqa.selenium.devtools.NetworkInterceptor;
import org.openqa.selenium.environment.webserver.NettyAppServer;
import org.openqa.selenium.remote.http.Contents;
import org.openqa.selenium.remote.http.Filter;
Expand Down
22 changes: 0 additions & 22 deletions java/test/org/openqa/selenium/support/devtools/BUILD.bazel

This file was deleted.

0 comments on commit 5a6504a

Please sign in to comment.