diff --git a/.github/config/android-arm.json b/.github/config/android-arm.json index 9ca34bb905096..92c3163470ae1 100644 --- a/.github/config/android-arm.json +++ b/.github/config/android-arm.json @@ -1,7 +1,7 @@ { "docker_service": "build-android", "on_device_test": { - "enabled": true, + "enabled": false, "tests": [ "0", "1", diff --git a/.github/config/android-arm64.json b/.github/config/android-arm64.json index 92f2e4a7e0112..77c941d1dcf1a 100644 --- a/.github/config/android-arm64.json +++ b/.github/config/android-arm64.json @@ -1,7 +1,7 @@ { "docker_service": "build-android", "on_device_test": { - "enabled": true, + "enabled": false, "tests": [ "0", "1", diff --git a/.github/config/android-x86.json b/.github/config/android-x86.json index 8a7b08bd40759..59c4df7267aaf 100644 --- a/.github/config/android-x86.json +++ b/.github/config/android-x86.json @@ -1,7 +1,7 @@ { "docker_service": "build-android", "on_device_test": { - "enabled": true, + "enabled": false, "tests": [ "0", "1", diff --git a/.github/config/raspi-2.json b/.github/config/raspi-2.json index 4114f2a5c6ded..f5842773665bb 100644 --- a/.github/config/raspi-2.json +++ b/.github/config/raspi-2.json @@ -3,12 +3,7 @@ "on_device_test": { "enabled": true, "tests": [ - "0", - "1", - "2", - "3", - "4", - "5" + "0" ] }, "platforms": [ diff --git a/.github/workflows/evergreen.yaml b/.github/workflows/evergreen.yaml index e33aba97c124a..61ab2ce7df960 100644 --- a/.github/workflows/evergreen.yaml +++ b/.github/workflows/evergreen.yaml @@ -11,7 +11,7 @@ on: - main - feature/* schedule: - - cron: '0 4 * * *' + - cron: '0 6 * * *' workflow_dispatch: inputs: nightly: diff --git a/.github/workflows/label-cherry-pick.yaml b/.github/workflows/label-cherry-pick.yaml new file mode 100644 index 0000000000000..803a82d287b43 --- /dev/null +++ b/.github/workflows/label-cherry-pick.yaml @@ -0,0 +1,87 @@ +name: Label Cherry Pick + +on: + pull_request_target: + types: + - labeled + - closed + +jobs: + prepare_branch_list: + runs-on: ubuntu-latest + outputs: + target_branch: ${{ steps.set-branches.outputs.target_branch }} + steps: + - name: Set Branches + id: set-branches + env: + PR_LABELS: ${{ toJson(github.event.pull_request.labels) }} + EVENT_ACTION: ${{ github.event.action }} + LABEL_NAME: ${{ github.event.label.name }} + BASE_REF: ${{ github.base_ref }} + run: | + if [[ $EVENT_ACTION == 'closed' ]]; then + labels=$(echo "$PR_LABELS" | jq -r '.[].name') + else + labels=$LABEL_NAME + fi + + branches=("23.lts.1+" "22.lts.1+" "21.lts.1+", "20.lts.1+" "19.lts.1+" "19.android.1+" "rc_11" "COBALT_9") + filtered_branches=() + for branch in "${branches[@]}"; do + if [[ $branch == $BASE_REF ]]; then + continue + fi + + for label in $labels; do + if [[ $label == "cp-$branch" ]]; then + filtered_branches+=("$branch") + fi + done + done + + echo "target_branch=$(echo -n "$filtered_branches" | jq -cRs 'split("\n")')" >> $GITHUB_OUTPUT + + cherry_pick: + runs-on: ubuntu-latest + needs: prepare_branch_list + if: | + needs.prepare_branch_list.outputs.target_branch != '[]' && + github.event.pull_request.merged == true && + github.event.pull_request.merge_commit_sha != null + strategy: + matrix: + target_branch: ${{ fromJson(needs.prepare_branch_list.outputs.target_branch) }} + env: + ACCESS_TOKEN: ${{ secrets.CHERRY_PICK_TOKEN }} + REPOSITORY: ${{ github.repository }} + GITHUB_REF: ${{ github.ref }} + MERGE_COMMIT_SHA: ${{ github.event.pull_request.merge_commit_sha }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + ref: ${{ matrix.target_branch }} + fetch-depth: 0 + + - name: Setup Git + run: | + git config --global user.name "GitHub Release Automation" + git config --global user.email "github@google.com" + + - name: Cherry pick merge commit + run: | + git fetch origin ${{ matrix.target_branch }} + git cherry-pick -x $MERGE_COMMIT_SHA + + - name: Create Pull Request + uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3 + with: + token: ${{ secrets.CHERRY_PICK_TOKEN }} + base: ${{ matrix.target_branch }} + branch: "${{ matrix.target_branch }}-${{ github.event.pull_request.number }}" + committer: GitHub Release Automation + reviewers: ${{ github.event.pull_request.user.login }} + title: "Cherry pick PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}" + body: | + "Refer to the original PR: https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }}" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 2373253224962..c68a98a021bfc 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ on: - feature/* concurrency: - group: '${{ github.workflow }}-${{ inputs.platform }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}' + group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.head.repo.id}}:${{ github.event.pull_request.head.label || github.head_ref || github.sha }}' cancel-in-progress: true permissions: {} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 02cc3e3ea4f0e..1573f1d4cc893 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -32,7 +32,7 @@ env: STARBOARD_TOOLCHAINS_DIR: /root/starboard-toolchains concurrency: - group: '${{ github.workflow }}-${{ inputs.platform }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}' + group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.number || github.sha }}' cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel @@ -230,11 +230,14 @@ jobs: # Runs on-host integration and unit tests. on-device-test: needs: [initialize, build] - if: | # Always run if not a PR or if the PR has on_device label - fromJSON(needs.initialize.outputs.on_device_test).enabled == true && ( - github.event_name != 'pull_request' || - contains(github.event.pull_request.labels.*.name, 'on_device') - ) + # Run if PR has on_device label, and on postsubmit and nightlies if + # repositories variables permit. + if: | + fromJSON(needs.initialize.outputs.on_device_test).enabled == true && (( + github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'on_device') ) + || ${{ inputs.nightly == 'true' && vars.RUN_ODT_TESTS_ON_NIGHTLY != 'False' }} || + ${{ github.event_name == 'push' && vars.RUN_ODT_TESTS_ON_POSTSUBMIT != 'False' }} ) runs-on: [self-hosted, linux, X64] name: ${{ matrix.name }}_on_device_${{ matrix.shard }} container: ${{ needs.docker-unittest-image.outputs.docker_unittest_tag }} @@ -249,6 +252,13 @@ jobs: env: COBALT_BOOTLOADER: ${{needs.initialize.outputs.bootloader}} steps: + - name: Print vars + run: | + echo "${{ vars.RUN_ODT_TESTS_ON_NIGHTLY }}" + echo "${{ vars.RUN_ODT_TESTS_ON_POSTSUBMIT }}" + echo 'NEXT' + echo "${{ env.RUN_ODT_TESTS_ON_NIGHTLY }}" + echo "${{ env.RUN_ODT_TESTS_ON_POSTSUBMIT }}" - name: Checkout uses: actions/checkout@v3 - name: Run Tests (${{ matrix.shard }}) diff --git a/.github/workflows/main_win.yaml b/.github/workflows/main_win.yaml index 60b0554c85a9e..1f2aee04bfc38 100644 --- a/.github/workflows/main_win.yaml +++ b/.github/workflows/main_win.yaml @@ -33,7 +33,7 @@ env: STARBOARD_TOOLCHAINS_DIR: /root/starboard-toolchains concurrency: - group: '${{ github.workflow }}-${{ inputs.platform }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}' + group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.head.repo.id}}:${{ github.event.pull_request.head.label || github.head_ref || github.sha }}' cancel-in-progress: true # A workflow run is made up of one or more jobs that can run sequentially or in parallel diff --git a/.github/workflows/pr_badges.yaml b/.github/workflows/pr_badges.yaml index d83d9a8ed4430..36613194c7bf8 100644 --- a/.github/workflows/pr_badges.yaml +++ b/.github/workflows/pr_badges.yaml @@ -14,9 +14,10 @@ on: - 'COBALT_9' concurrency: - group: '${{ github.workflow }}-${{ inputs.platform }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}' + group: '${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.pull_request.head.repo.id}}:${{ github.event.pull_request.head.label || github.head_ref || github.sha }}' cancel-in-progress: true + permissions: pull-requests: write diff --git a/.github/workflows/raspi-2.yaml b/.github/workflows/raspi-2.yaml index 74756bac06a2e..79ebcee9366a6 100644 --- a/.github/workflows/raspi-2.yaml +++ b/.github/workflows/raspi-2.yaml @@ -11,7 +11,7 @@ on: - main - feature/* schedule: - - cron: '0 4 * * *' + - cron: '0 7 * * *' workflow_dispatch: inputs: nightly: @@ -29,11 +29,11 @@ jobs: with: platform: raspi-2 nightly: ${{ github.event.inputs.nightly }} - raspi-2-skia: - uses: ./.github/workflows/main.yaml - permissions: - packages: write - pull-requests: write - with: - platform: raspi-2-skia - nightly: ${{ github.event.inputs.nightly }} + # raspi-2-skia: + # uses: ./.github/workflows/main.yaml + # permissions: + # packages: write + # pull-requests: write + # with: + # platform: raspi-2-skia + # nightly: ${{ github.event.inputs.nightly }} diff --git a/.github/workflows/stub.yaml b/.github/workflows/stub.yaml index d387f51882616..6e4c7b2a15525 100644 --- a/.github/workflows/stub.yaml +++ b/.github/workflows/stub.yaml @@ -17,8 +17,22 @@ on: required: true type: boolean default: false +env: + RUN_ODT_TESTS_ON_NIGHTLY: ${{ vars.RUN_ODT_TESTS_ON_NIGHTLY }} + RUN_ODT_TESTS_ON_POSTSUBMIT: ${{ vars.RUN_ODT_TESTS_ON_POSTSUBMIT }} jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. + echo "${{ vars.RUN_ODT_TESTS_ON_NIGHTLY }}" + echo "${{ vars.RUN_ODT_TESTS_ON_POSTSUBMIT }}" + echo "${{ env.RUN_ODT_TESTS_ON_NIGHTLY }}" + echo "${{ env.RUN_ODT_TESTS_ON_POSTSUBMIT }}" stub: uses: ./.github/workflows/main.yaml permissions: diff --git a/.github/workflows/test-report.yaml b/.github/workflows/test-report.yaml new file mode 100644 index 0000000000000..c8dfe8bec925c --- /dev/null +++ b/.github/workflows/test-report.yaml @@ -0,0 +1,26 @@ +name: 'Test Report' +on: + workflow_run: + # runs after main workflow + workflows: + - evergreen + - linux + # TODO + # - win32 + types: + - completed +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Download test results + uses: actions/download-artifact@v3 + with: + name: unit-test-report + path: ${GITHUB_WORKSPACE}/test_results + - name: Create Report + uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 + with: + name: Cobalt Unit Tests + path: ${GITHUB_WORKSPACE}/test_results/**/*.xml + reporter: jest-junit diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000000000..5e246a1bd9f84 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,29 @@ +name: repo_vars + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +env: + RUN_ODT_TESTS_ON_NIGHTLY: ${{ vars.RUN_ODT_TESTS_ON_NIGHTLY }} + RUN_ODT_TESTS_ON_POSTSUBMIT: ${{ vars.RUN_ODT_TESTS_ON_POSTSUBMIT }} + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. + echo "${{ vars.RUN_ODT_TESTS_ON_NIGHTLY }}" + echo "${{ vars.RUN_ODT_TESTS_ON_POSTSUBMIT }}" + echo "${{ env.RUN_ODT_TESTS_ON_NIGHTLY }}" + echo "${{ env.RUN_ODT_TESTS_ON_POSTSUBMIT }}" diff --git a/.github/workflows/workflow_trigger.yaml b/.github/workflows/workflow_trigger.yaml new file mode 100644 index 0000000000000..ac9b93305c6b7 --- /dev/null +++ b/.github/workflows/workflow_trigger.yaml @@ -0,0 +1,48 @@ +name: workflow_trigger + +on: + workflow_dispatch: + inputs: + branch: + type: choice + description: Branch + options: + - '23.lts.1+' + - '22.lts.1+' + - '21.lts.1+' + - '20.lts.1+' + - '19.lts.1+' + - 'rc_11' + - 'COBALT_9' + workflow: + type: choice + description: Workflow name + options: + - 'android' + - 'evergreen' + - 'linux' + - 'raspi' + - 'win32' + nightly: + description: 'Nightly workflow.' + required: true + type: boolean + default: false + +jobs: + trigger: + permissions: + actions: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 1 + ref: ${{github.event.branch}} + - name: Trigger Nightly + run: | + set -x + gh workflow run ${{github.event.inputs.workflow}}_${{github.event.inputs.branch}} --ref ${{github.event.inputs.branch}} -f nightly=${{github.event.inputs.nightly}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 9a5a5caa9c013..28ba8eb52921e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /venv/* _certs/ .coverage + diff --git a/BUILD.gn b/BUILD.gn index d2d4ccd63b57f..1363623328751 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + group("gn_all") { testonly = true diff --git a/README.md b/README.md index 8f2fff9c03432..1410af546b8f7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Cobalt [![Build Status](https://img.shields.io/badge/-Build%20Status-blueviolet)](https://github.com/youtube/cobalt/blob/main/BUILD_STATUS.md) -Test change - ## Overview Cobalt is a lightweight application container (i.e. an application runtime, like @@ -73,6 +71,8 @@ Chromium, FireFox, and IE: ## Architecture +One more test + The Cobalt Authors forked H5VCC, removed most of the Chromium code -- in particular WebCore and the Chrome Renderer and Compositor -- and built up from scratch an implementation of a simplified subset of HTML, the CSS Box Model for diff --git a/cobalt/webdriver/algorithms.cc b/cobalt/webdriver/algorithms.cc index e4c6a5b662496..155e60535f281 100644 --- a/cobalt/webdriver/algorithms.cc +++ b/cobalt/webdriver/algorithms.cc @@ -455,7 +455,7 @@ std::string GetElementText(dom::Element* element) { } // There is a spec for "displayedness" available: -// https://w3c.github.io/webdriver/webdriver-spec.html#element-displayedness +// https://www.w3.org/TR/2015/WD-webdriver-20150808/#element-displayedness // However, the algorithm described in the spec does not match existing // implementations of WebDriver. // IsDisplayed will match the existing implementations, using the implementation diff --git a/cobalt/webdriver/algorithms.h b/cobalt/webdriver/algorithms.h index d75d3b2be157c..df7f2ccb296a2 100644 --- a/cobalt/webdriver/algorithms.h +++ b/cobalt/webdriver/algorithms.h @@ -24,13 +24,13 @@ namespace webdriver { namespace algorithms { // Implementation of getElementText algorithm. -// https://w3c.github.io/webdriver/webdriver-spec.html#getelementtext +// https://www.w3.org/TR/2015/WD-webdriver-20150808/#getelementtext // The spec is not totally clear and, according to comments on the spec, does // not exactly match the behavior of existing WebDriver implementations. This // implementation will follow the de-facto standards where they differ. std::string GetElementText(dom::Element* element); -// https://w3c.github.io/webdriver/webdriver-spec.html#element-displayedness +// https://www.w3.org/TR/2015/WD-webdriver-20150808/#element-displayedness // The spec does not exactly match the behavior of existing WebDriver // implementations. Consistency with existing implementations will be preferred // over strict conformance to the draft spec. diff --git a/cobalt/webdriver/dispatcher.h b/cobalt/webdriver/dispatcher.h index 56796babe9428..ae29bb1348592 100644 --- a/cobalt/webdriver/dispatcher.h +++ b/cobalt/webdriver/dispatcher.h @@ -76,8 +76,8 @@ class WebDriverDispatcher { }; // Send the result of the execution of a registered WebDriver command to be // sent as a response as described in the spec: - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Responses - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Failed-Commands + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#responses + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#failed-commands virtual void SendResult( const base::Optional& session_id, protocol::Response::StatusCode status_code, @@ -95,7 +95,7 @@ class WebDriverDispatcher { // Some forms of Invalid Requests are detected in the CommandCallback by // checking the path variables and command parameters. Invalid requests are // described here: - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Invalid-Requests + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#invalid-requests // // TODO: Invalid requests should be handled before calling the // CommandCallback. diff --git a/cobalt/webdriver/element_driver.cc b/cobalt/webdriver/element_driver.cc index 0f36d4bee435e..9fbd3113cf7bf 100644 --- a/cobalt/webdriver/element_driver.cc +++ b/cobalt/webdriver/element_driver.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include "cobalt/webdriver/element_driver.h" +#include + #include "cobalt/cssom/property_value.h" #include "cobalt/cssom/viewport_size.h" #include "cobalt/dom/document.h" @@ -266,14 +266,14 @@ util::CommandResult ElementDriver::SendClickInternal( return CommandResult(protocol::Response::kElementNotVisible); } // Click on an element. - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidclick + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidelementidclick // The Element Click clicks the in-view center point of the element - // https://w3c.github.io/webdriver/webdriver-spec.html#dfn-element-click + // https://www.w3.org/TR/2015/WD-webdriver-20150808/#click // An element's in-view center point is the origin position of the rectangle // that is the intersection between the element's first DOM client rectangle // and the initial viewport. - // https://w3c.github.io/webdriver/webdriver-spec.html#dfn-in-view-center-point + // https://www.w3.org/TR/2017/WD-webdriver-20170125/#dfn-in-view-center-point scoped_refptr dom_rects = element_->GetClientRects(); if (dom_rects->length() == 0) { return CommandResult(protocol::Response::kElementNotVisible); diff --git a/cobalt/webdriver/element_driver.h b/cobalt/webdriver/element_driver.h index 5a29e5dbad27e..471f129369ea9 100644 --- a/cobalt/webdriver/element_driver.h +++ b/cobalt/webdriver/element_driver.h @@ -46,7 +46,7 @@ class WindowDriver; // ElementDriver could be considered a WebElement as described in the WebDriver // spec. -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#webelement +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#webelement // Commands that interact with a WebElement, such as: // /session/:sessionId/element/:id/some_command // will map to a method on this class. diff --git a/cobalt/webdriver/protocol/button.h b/cobalt/webdriver/protocol/button.h index 9866ea5cf6710..50db38010cba6 100644 --- a/cobalt/webdriver/protocol/button.h +++ b/cobalt/webdriver/protocol/button.h @@ -27,9 +27,9 @@ namespace protocol { // Represents the JSON parameters passed to the click, buttondown, and buttonup // WebDriver commands. -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidclick -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidbuttondown -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidbuttonup +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidelementidclick +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidbuttondown +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidbuttonup class Button { public: static std::unique_ptr ToValue(const Button& button); diff --git a/cobalt/webdriver/protocol/capabilities.h b/cobalt/webdriver/protocol/capabilities.h index 54ca1b08c294a..87893de1dfc2a 100644 --- a/cobalt/webdriver/protocol/capabilities.h +++ b/cobalt/webdriver/protocol/capabilities.h @@ -45,7 +45,7 @@ class Capabilities { private: Capabilities() {} // The capabilities listed here: - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Capabilities-JSON-Object + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#capabilities-json-object base::Optional browser_name_; base::Optional version_; diff --git a/cobalt/webdriver/protocol/cookie.h b/cobalt/webdriver/protocol/cookie.h index 4d1357d888a33..70f69cbe48544 100644 --- a/cobalt/webdriver/protocol/cookie.h +++ b/cobalt/webdriver/protocol/cookie.h @@ -27,7 +27,7 @@ namespace cobalt { namespace webdriver { namespace protocol { -// https://w3c.github.io/webdriver/webdriver-spec.html#cookies +// https://www.w3.org/TR/2015/WD-webdriver-20150808/#cookies class Cookie { public: static std::unique_ptr ToValue(const Cookie& cookie); diff --git a/cobalt/webdriver/protocol/element_id.h b/cobalt/webdriver/protocol/element_id.h index 94b75c383c968..ec322a64c3614 100644 --- a/cobalt/webdriver/protocol/element_id.h +++ b/cobalt/webdriver/protocol/element_id.h @@ -31,7 +31,7 @@ class ElementId { static const char kElementKey[]; // Convert the ElementId to a WebElement JSON object: - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#WebElement-JSON-Object + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#webelement-json-object static std::unique_ptr ToValue(const ElementId& element_id); static base::Optional FromValue(const base::Value* value); diff --git a/cobalt/webdriver/protocol/frame_id.h b/cobalt/webdriver/protocol/frame_id.h index 4e2e7ce1ed33c..3cdaeb7540e23 100644 --- a/cobalt/webdriver/protocol/frame_id.h +++ b/cobalt/webdriver/protocol/frame_id.h @@ -22,7 +22,7 @@ namespace cobalt { namespace webdriver { namespace protocol { -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidframe +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidframe // Since Cobalt doesn't support multiple frames, the only valid value for this // command is to request switching to the top-level browsing context, which // is always active. diff --git a/cobalt/webdriver/protocol/log_entry.cc b/cobalt/webdriver/protocol/log_entry.cc index 297c0847adefe..d0682c1125fd6 100644 --- a/cobalt/webdriver/protocol/log_entry.cc +++ b/cobalt/webdriver/protocol/log_entry.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include "cobalt/webdriver/protocol/log_entry.h" +#include + #include "base/logging.h" namespace cobalt { @@ -48,7 +48,7 @@ std::unique_ptr LogEntry::ToValue(const LogEntry& log_entry) { std::unique_ptr log_entry_value( new base::DictionaryValue()); // Format of the Log Entry object can be found here: - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Log-Entry-JSON-Object + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#log-entry-json-object // timestamp is in milliseconds since the Unix Epoch. log_entry_value->SetInteger("timestamp", log_entry.timestamp_.InMilliseconds()); diff --git a/cobalt/webdriver/protocol/log_entry.h b/cobalt/webdriver/protocol/log_entry.h index 94d01bdd2d83a..777b66f8b96e3 100644 --- a/cobalt/webdriver/protocol/log_entry.h +++ b/cobalt/webdriver/protocol/log_entry.h @@ -26,7 +26,7 @@ namespace webdriver { namespace protocol { // Log entry object: -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Log-Entry-JSON-Object +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#log-entry-json-object class LogEntry { public: enum LogLevel { diff --git a/cobalt/webdriver/protocol/moveto.h b/cobalt/webdriver/protocol/moveto.h index c1be6dcb39425..0819a1fab8a0f 100644 --- a/cobalt/webdriver/protocol/moveto.h +++ b/cobalt/webdriver/protocol/moveto.h @@ -26,7 +26,7 @@ namespace webdriver { namespace protocol { // Represents the JSON parameters passed to the moveto WebDriver command. -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidmoveto +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidmoveto class Moveto { public: static std::unique_ptr ToValue(const Moveto& moveto); diff --git a/cobalt/webdriver/protocol/response.h b/cobalt/webdriver/protocol/response.h index 0244c1453d4ff..1995ed2ca4882 100644 --- a/cobalt/webdriver/protocol/response.h +++ b/cobalt/webdriver/protocol/response.h @@ -29,7 +29,7 @@ namespace protocol { class Response { public: // WebDriver Response Status Codes: - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Response-Status-Codes + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#response-status-codes enum StatusCode { // The command executed successfully. kSuccess = 0, @@ -79,13 +79,13 @@ class Response { // Create a JSON object that will be used as the response body for a failed // command: - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Failed-Commands + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#failed-commands // TODO: Add support for screenshot, stack trace, etc. static std::unique_ptr CreateErrorResponse( const std::string& message); // Create a JSON object that will be used as the response body for a command: - // https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#Responses + // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#responses static std::unique_ptr CreateResponse( const base::Optional& session_id, StatusCode status_code, diff --git a/cobalt/webdriver/protocol/script.h b/cobalt/webdriver/protocol/script.h index 78256fc31adce..e1ad598b6b3d9 100644 --- a/cobalt/webdriver/protocol/script.h +++ b/cobalt/webdriver/protocol/script.h @@ -27,8 +27,8 @@ namespace protocol { // Represents the JSON parameters passed to the execute and execute_async // WebDriver commands. -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidexecute -// https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidexecute-async +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidexecute +// https://www.selenium.dev/documentation/legacy/json_wire_protocol/#sessionsessionidexecute_async class Script { public: static base::Optional