This document provides essential instructions and best practices for developing in the third_party/blink/renderer/core tree. Adhere to these guidelines to ensure consistency and quality.
out/Default is assumed. Replace out/Default with the local output dir, as appropriate.autoninja -C out/Default chrome.third_party/blink/web_tests/external/wpt.third_party/blink/tools/run_wpt_tests.py -t Default {testname} where {testname} is something like external/wpt/shadow-dom/some-test-name.html. Do not include the leading third_party/blink/web_tests/ part of the test path when running tests like this, but do include the external/wpt/.third_party/blink/tools/run_web_tests.py -t Default {testname} where {testname} is something like fast/frames/some-test-name.html. Do not include the leading third_party/blink/web_tests/ part of the test path when running tests like this.autoninja -C out/Default blink_tests.--no-manifest-update on subsequent runs to skip the rebuild — as long as no test files have been added, removed, renamed, or had their metadata headers changed since the last rebuild. When in doubt, omit the flag and let the manifest rebuild. If a test that should exist is not found or produces unexpected results, the manifest may be stale — retry without --no-manifest-update to rebuild it.--iterations 10 to the run_wpt_tests.py or run_web_tests.py command line, to repeat the test 10 times.cat out/Default/layout-test-results/[test path]/{testname}-stderr.txt or ...{testname}-actual.txt. For example, cat out/Default/layout-test-results/external/wpt/shadow-dom/some-test-name-stderr.txt or cat out/Default/layout-test-results/fast/frames/some-test-name-actual.txt.third_party/blink/web_tests/TestExpectations is used to modify the behavior of these test suites. Each line in this file has a prefix (bug number and operating systems impacted), a test path, and a suffix containing allowed test results. The results can be one or more of: Timeout, Crash, Pass, Failure, or Skip. If a test matches a line in this file, the actual test result is compared to the allowed test results list, and if any of them match, the test is reported as working “as expected”. When debugging test failures, it is important to check this file first, to avoid false positives. E.g. If the test is listed with [ Failure Pass ], then the test will appear to succeed if it passes or fails. Often the best course of action is to delete the line with the test in question before attempting to reproduce a failure or fix a bug.third_party/blink/web_tests/platform/. The file will be named {testname without extension}-expected.txt. When trying to reproduce flakiness or failures, or fix bugs, it might be important to first delete or at least examine the expectation file. If the test outputs exactly what is contained in the expectation file, the test runner will report that the test ran “as expected”.autoninja -C out/Default blink_unittests.out/Default/blink_unittests --gtest_filter="{testname}" where {testname} is the qualified test name. You can include asterisks to include Param variations. For example, --gtest_filter="*TestSuiteName.TestPrefixOrName*".autoninja -C out/Default browser_tests.out/Default/browser_tests --gtest_filter="{testname}" where {testname} is the qualified test name. You can include asterisks to include Param variations. For example, --gtest_filter="*TestSuiteName.TestPrefixOrName*".third_party/blink/renderer/platform/runtime_enabled_features.json5 file, as an object in the array with name: "FeatureName", and status: {a string}.RuntimeEnabledFeatures::FeaturenameEnabled(). For example, for a feature with name: "FeatureName", you can check via RuntimeEnabledFeatures::FeatureNameEnabled().base::Feature of the same name. That feature can be checked with base::FeatureList::IsEnabled(features::kFeatureName). Typically, though, that shouldn't be done, and only the status of the runtime enabled feature should be used/checked.LOG(ERROR) << "Some interesting state " << some_variable;. When it isn't clear what the code is doing, try adding debugging statements such as this before running tests, to confirm your understanding.echo $(date +%Y).// See crbug.com/123456 if you don‘t know 123456 is valid for what you’re doing.