0
Commit Graph

337 Commits

Author SHA1 Message Date
Henrique Nakashima
224ee248b1 Reland "Add _CheckAndroidNullAwayAnnotatedClasses PRESUBMIT check"
Doing a simpler check, not trying to figure out if the annotation is in the class declaration or on a method declaration. It would be
very rare for a method to be annotation and not the class.

This reverts commit ae8498e751.

Reason for revert: Fixed version

Original change's description:
> Revert "Add _CheckAndroidNullAwayAnnotatedClasses PRESUBMIT check"
>
> This reverts commit cfe861e365.
>
> Reason for revert: Doesn't ignore comments
>
> Original change's description:
> > Add _CheckAndroidNullAwayAnnotatedClasses PRESUBMIT check
> >
> > Warn when a .java file is missing @NullMarked and @NullUnmarked.
> >
> > Temporarily disabled in //android_webview and //chrome while migrating.
> >
> > Bug: 404884589
> > Change-Id: I38e331bcec6f3a3f2147c0999fd4dca8fef145d5
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6373892
> > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
> > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1435461}
>
> Bug: 404884589
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Change-Id: I669658f3f21cab9365f0c50b4e0191a1e6a608a0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6377728
> Auto-Submit: Henrique Nakashima <hnakashima@chromium.org>
> Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1435593}

Bug: 404884589
Change-Id: I11d0ed28bf1941e72df5dcc457fb9d7e62dc89ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6381838
Auto-Submit: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1436182}
2025-03-21 11:35:02 -07:00
Henrique Nakashima
ae8498e751 Revert "Add _CheckAndroidNullAwayAnnotatedClasses PRESUBMIT check"
This reverts commit cfe861e365.

Reason for revert: Doesn't ignore comments

Original change's description:
> Add _CheckAndroidNullAwayAnnotatedClasses PRESUBMIT check
>
> Warn when a .java file is missing @NullMarked and @NullUnmarked.
>
> Temporarily disabled in //android_webview and //chrome while migrating.
>
> Bug: 404884589
> Change-Id: I38e331bcec6f3a3f2147c0999fd4dca8fef145d5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6373892
> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1435461}

Bug: 404884589
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I669658f3f21cab9365f0c50b4e0191a1e6a608a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6377728
Auto-Submit: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1435593}
2025-03-20 12:04:35 -07:00
Henrique Nakashima
cfe861e365 Add _CheckAndroidNullAwayAnnotatedClasses PRESUBMIT check
Warn when a .java file is missing @NullMarked and @NullUnmarked.

Temporarily disabled in //android_webview and //chrome while migrating.

Bug: 404884589
Change-Id: I38e331bcec6f3a3f2147c0999fd4dca8fef145d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6373892
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1435461}
2025-03-20 09:02:35 -07:00
Nate Fischer
d541ff839b Android: presubmit check against IS_DESKTOP_ANDROID
No change to production behavior. This adds a presubmit check for
IS_DESKTOP_ANDROID. The goal is to confine use of this value to chrome/
layer and other higher layers, but to ban this in content/ layer and
below.

This has "warning" status only so that it can be bypassed in case of
false positive, however the intention is that generally
IS_DESKTOP_ANDROID should only live in higher layers.

Fixed: 401628399
Test: vpython3 PRESUBMIT_test.py
Change-Id: Ice010be105a476100acf5cf70a3d262228916c33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6336803
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431159}
2025-03-11 14:34:19 -07:00
Jenna Himawan
859865d196 [a11y] Presubmit ban disruptive a11y announcements
Ban announceForAccessibility and TYPE_ANNOUNCEMENT, deprecated in
Baklava (Android 16).

Fixed: 376759129
Test: PRESUBMIT_test.py
Change-Id: I55b9e8f77d5ec4cb865da94f230a3c57d4bcf4e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6301847
Commit-Queue: Jenna Himawan <jhimawan@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Lijin Shen <lazzzis@google.com>
Cr-Commit-Position: refs/heads/main@{#1424803}
2025-02-25 14:22:31 -08:00
Andrew Grieve
851a7be79e Android: Remove Mockito.mock() R8 work-arounds
R8 now natively supports tracing of Mockito.mock() and Mockito.spy()

Bug: 389166093
Change-Id: Iffa791d1af203f621130f247fa995f038df9d6ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6226560
Reviewed-by: Sam Maier <smaier@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1418690}
2025-02-11 08:41:01 -08:00
Mark Pearson
63204dad1a Revert "Add presubmit check to prevent anonymous namespace usage in headers"
This reverts commit ba1e976cd9.

Reason for revert:
Causes failures on win-presubmit bot, starting here when it landed:
https://ci.chromium.org/ui/p/chromium/builders/ci/win-presubmit/11338/overview

It seems the existing problems in the repository were not cleaned up before landing this new check.

Full error message:
===
These files have an anonymous namespace which is not permitted in header files, for more information see (https://google.github.io/styleguide/cppguide.html#Internal_Linkage): 
  ash\accelerators\ash_accelerator_configuration.h
  ash\accessibility\ui\accessibility_confirmation_dialog.h
  ash\ambient\test\ambient_ash_test_base.h
  ash\glanceables\classroom\fake_glanceables_classroom_client.h
  ash\hud_display\hud_settings_view.h
  ash\lobster\lobster_image_actuator.h
  ash\login\ui\lock_contents_view_constants.h
  ash\login\ui\lock_screen_media_view.h
  ash\system\accessibility\dictation_bubble_view.h
  ash\system\diagnostics\fake_diagnostics_browser_delegate.h
  ash\system\focus_mode\focus_mode_chip_carousel.h
  ash\system\focus_mode\focus_mode_detailed_view.h
  ash\system\media\quick_settings_media_view.h
  ash\system\network\fake_network_detailed_view_delegate.h
  ash\system\network\network_detailed_network_view.h
  ash\system\notification_center\notification_grouping_controller.h
  ash\system\power\power_sounds_controller.h
  ash\system\time\calendar_model.h
  ash\system\time\calendar_unittest_utils.h
  ash\webui\eche_app_ui\accessibility_tree_converter.h
  ash\webui\help_app_ui\search\search_handler.h
  ash\webui\shortcut_customization_ui\backend\accelerator_layout_table.h
  base\allocator\miracle_parameter.h
  base\allocator\partition_allocator\src\partition_alloc\shim\allocator_shim_override_apple_default_zone.h
  base\allocator\partition_allocator\src\partition_alloc\shim\allocator_shim_override_glibc_weak_symbols.h
  base\allocator\partition_allocator\src\partition_alloc\shim\allocator_shim_override_ucrt_symbols_win.h
  base\allocator\partition_allocator\src\partition_alloc\shim\shim_alloc_functions.h
  base\memory\safety_checks.h
  base\task\lazy_thread_pool_task_runner.h
  base\task\thread_pool\pooled_single_thread_task_runner_manager.h
  base\test\fuzztest_support.h
  base\time\time.h
  chrome\browser\accessibility\live_caption\live_caption_speech_recognition_host_browsertest.h
  chrome\browser\android\metrics\android_session_durations_service.h
  chrome\browser\ash\app_list\search\arc\arc_app_shortcut_search_result.h
  chrome\browser\ash\app_restore\app_restore_arc_task_handler.h
  chrome\browser\ash\arc\instance_throttle\arc_active_window_throttle_observer.h
  chrome\browser\ash\file_manager\trash_io_task.h
  chrome\browser\ash\guest_os\vm_sk_forwarding_native_message_host.h
  chrome\browser\ash\lobster\lobster_insertion.h
  chrome\browser\ash\login\existing_user_controller_base_test.h
  chrome\browser\ash\login\test\feature_parameter_interface.h
  chrome\browser\ash\policy\skyvault\test\skyvault_test_utils.h
  chrome\browser\ash\smb_client\smb_service_test_base.h
  chrome\browser\ash\system_web_apps\apps\personalization_app\keyboard_backlight_color_metrics_provider.h
  chrome\browser\chromeos\extensions\telemetry\api\events\event_router.h
  chrome\browser\extensions\api\messaging\native_message_echo_host.h
  chrome\browser\extensions\context_menu_helpers.h
  chrome\browser\media\prefs\capture_device_ranking.h
  chrome\browser\metrics\chrome_metrics_service_accessor.h
  chrome\browser\metrics\structured\chrome_structured_metrics_delegate.h
  chrome\browser\metrics\structured\metadata_processor_ash.h
  chrome\browser\nearby_sharing\wifi_network_configuration\fake_wifi_network_configuration_handler.h
  chrome\browser\page_load_metrics\observers\third_party_cookie_deprecation_page_load_metrics_observer.h
  chrome\browser\password_manager\password_change_delegate_impl.h
  chrome\browser\performance_manager\decorators\helpers\page_live_state_decorator_helper.h
  chrome\browser\permissions\crowd_deny_preload_data.h
  chrome\browser\persisted_state_db\session_proto_db_factory.h
  chrome\browser\profile_resetter\profile_resetter.h
  chrome\browser\push_messaging\push_messaging_service_impl.h
  chrome\browser\screen_ai\public\optical_character_recognizer.h
  chrome\browser\screen_ai\screen_ai_service_router.h
  chrome\browser\ui\ash\wallpaper\wallpaper_controller_client_impl.h
  chrome\browser\ui\cocoa\history_menu_bridge.h
  chrome\browser\ui\global_media_controls\media_item_ui_metrics.h
  chrome\browser\ui\passwords\manage_passwords_ui_controller.h
  chrome\browser\ui\performance_controls\performance_intervention_button_controller.h
  chrome\browser\ui\performance_controls\test_support\memory_saver_browser_test_mixin.h
  chrome\browser\ui\safety_hub\abusive_notification_permissions_manager.h
  chrome\browser\ui\safety_hub\menu_notification_service.h
  chrome\browser\ui\signin\signin_view_controller.h
  chrome\browser\ui\views\desktop_capture\desktop_media_tab_list.h
  chrome\browser\ui\views\frame\picture_in_picture_browser_frame_view.h
  chrome\browser\ui\views\global_media_controls\media_item_ui_cast_footer_view.h
  chrome\browser\ui\views\global_media_controls\media_item_ui_device_selector_view.h
  chrome\browser\ui\views\global_media_controls\media_item_ui_footer_view.h
  chrome\browser\ui\views\site_data\page_specific_site_data_dialog.h
  chrome\browser\ui\views\web_apps\frame_toolbar\web_app_frame_toolbar_view.h
  chrome\browser\ui\web_applications\sub_apps_service_impl.h
  chrome\browser\ui\web_applications\test\isolated_web_app_test_utils.h
  chrome\browser\ui\webui\ash\diagnostics_dialog\diagnostics_dialog.h
  chrome\browser\ui\webui\ash\login\consolidated_consent_screen_handler.h
  chrome\browser\ui\webui\ash\sanitize_dialog\sanitize_dialog.h
  chrome\browser\ui\webui\ash\settings\pages\apps\mojom\app_type_mojom_traits.h
  chrome\browser\web_applications\isolated_web_apps\isolated_web_app_update_manager.h
  chrome\browser\web_applications\preinstalled_web_app_manager.h
  chrome\common\read_anything\read_anything_constants.h
  chrome\test\base\ash\web_ui_browser_test.h
  chrome\test\base\chromeos\crosier\chromeos_integration_login_mixin.h
  chrome\updater\app\server\win\com_classes_legacy.h
  chromecast\media\base\aligned_buffer.h
  chromeos\ash\components\assistant\test_support\expect_utils.h
  chromeos\ash\components\carrier_lock\psm_claim_verifier_unittest.h
  chromeos\ash\components\game_mode\game_mode_controller.h
  chromeos\ash\components\nearby\presence\nearby_presence_service_impl.h
  chromeos\ash\components\phonehub\fake_multidevice_feature_access_manager.h
  chromeos\ash\components\phonehub\phone_hub_structured_metrics_logger.h
  chromeos\ash\components\string_matching\prefix_matcher.h
  chromeos\ash\components\string_matching\sequence_matcher.h
  chromeos\ash\experiences\arc\arc_browser_context_keyed_service_factory_base.h
  chromeos\ash\experiences\arc\metrics\arc_daily_metrics.h
  chromeos\ash\experiences\arc\window\arc_window_watcher.h
  chromeos\ash\services\quick_pair\public\mojom\fast_pair_traits.h
  components\autofill\ios\browser\form_suggestion_provider_query.h
  components\background_sync\background_sync_metrics.h
  components\commerce\core\product_specifications\product_specifications_set.h
  components\commerce\core\test_utils.h
  components\crash\core\common\crash_key.h
  components\discardable_memory\service\discardable_shared_memory_manager.h
  components\endpoint_fetcher\endpoint_fetcher.h
  components\exo\wayland\clients\test\client_version_test.h
  components\exo\wayland\compatibility_test\wayland_client_event_receiver_version_fixtures.h
  components\exo\wayland\wayland_dmabuf_feedback_manager.h
  components\feed\core\v2\public\ios\info_card_tracker.h
  components\global_media_controls\public\views\media_item_ui_detailed_view.h
  components\gwp_asan\client\thread_local_random_bit_generator.h
  components\leveldb_proto\internal\proto_database_impl.h
  components\leveldb_proto\testing\fake_db.h
  components\live_caption\views\caption_bubble.h
  components\metrics\structured\delegating_events_processor.h
  components\metrics\structured\events_processor_interface.h
  components\metrics\structured\recorder.h
  components\optimization_guide\core\model_handler.h
  components\optimization_guide\core\tflite_model_executor.h
  components\session_proto_db\session_proto_db.h
  components\unexportable_keys\unexportable_key_service_impl.h
  components\update_client\background_downloader_mac.h
  components\viz\service\debugger\viz_debugger.h
  content\browser\accessibility\web_contents_accessibility_android.h
  content\browser\back_forward_cache_test_util.h
  content\browser\background_sync\background_sync_base_browsertest.h
  content\browser\bluetooth\advertisement_client.h
  content\browser\client_hints\critical_client_hints_throttle.h
  content\browser\locks\lock_manager.h
  content\browser\presentation\presentation_test_utils.h
  content\browser\tracing\trace_report\trace_report_mojom_traits.h
  content\public\browser\sms_fetcher.h
  content\public\browser\storage_notification_service.h
  device\bluetooth\floss\exported_callback_manager.h
  extensions\browser\api\storage\settings_namespace.h
  gpu\ipc\client\gpu_context_tests.h
  media\base\eme_constants.h
  media\base\mock_media_log.h
  media\base\use_after_free_checker.h
  media\capture\video\mac\video_capture_device_decklink_mac.h
  media\cdm\cdm_wrapper.h
  media\device_monitors\device_monitor_mac.h
  media\formats\hls\types.h
  media\gpu\chromeos\shaders\shaders.h
  media\gpu\v4l2\mt21\mt21_util.h
  media\gpu\v4l2\v4l2_jpeg_encode_accelerator.h
  media\renderers\win\media_foundation_stream_wrapper.h
  native_client_sdk\src\examples\api\video_decode\testdata.h
  net\cert\internal\cert_issuer_source_sync_unittest.h
  net\cert\root_cert_list_generated.h
  net\cookies\cookie_store_change_unittest.h
  net\dns\stale_host_resolver.h
  net\nqe\socket_watcher.h
  net\nqe\socket_watcher_factory.h
  net\nqe\throughput_analyzer.h
  net\quic\quic_proxy_client_socket_test_base.h
  net\ssl\client_cert_store_unittest-inl.h
  net\tools\huffman_trie\huffman\huffman_builder.h
  net\traffic_annotation\network_traffic_annotation.h
  ppapi\cpp\input_event_interface_name.h
  ppapi\cpp\module_impl.h
  ppapi\examples\video_decode\testdata.h
  ppapi\tests\test_udp_socket.h
  sandbox\win\src\crosscall_params.h
  sandbox\win\src\process_thread_interception.h
  services\device\generic_sensor\orientation_test_data.h
  testing\multiprocess_func_list.h
  third_party\blink\renderer\bindings\core\v8\iterable.h
  third_party\blink\renderer\core\editing\finder\find_task_controller.h
  third_party\blink\renderer\core\layout\grid\grid_data.h
  third_party\blink\renderer\core\loader\document_loader.h
  third_party\blink\renderer\modules\canvas\canvas2d\base_rendering_context_2d.h
  third_party\blink\renderer\modules\compute_pressure\pressure_observer.h
  third_party\blink\renderer\platform\geometry\math_functions.h
  third_party\blink\renderer\platform\peerconnection\webrtc_connection_matchers.h
  third_party\blink\renderer\platform\scheduler\public\frame_or_worker_scheduler.h
  third_party\blink\renderer\platform\text\emoji_segmentation_category_inline_header.h
  tools\win\chromeexts\chrome_exts_command.h
  ui\accessibility\platform\fuchsia\semantic_provider_impl.h
  ui\base\class_property.h
  ui\base\clipboard\clipboard_test_template.h
  ui\events\fuchsia\util\pointer_event_utility.h
  ui\events\ozone\device\device_event.h
  ui\events\velocity_tracker\velocity_tracker.h
  ui\gfx\animation\keyframe\keyframed_animation_curve-inl.h
  ui\gfx\mojom\rrect_f_mojom_traits.h
  ui\gfx\mojom\selection_bound_mojom_traits.h
  ui\gl\delegated_ink_point_renderer_gpu.h
  ui\gl\gl_enums_implementation_autogen.h
  ui\webui\resources\cr_components\app_management\app_management_mojom_traits.h
===

which I got by copying and pasting from
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8724556290967808561/+/u/presubmit/stdout

Original change's description:
> Add presubmit check to prevent anonymous namespace usage in headers
>
> Bug: 391905435
> Change-Id: I928d282bc3b626addc564889338cb7426e7cbe4c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6192789
> Commit-Queue: Aaron Selya <selya@google.com>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1411842}

Bug: 391905435
Change-Id: I8753a2777b650bf5716c6364b3ba160c503a236e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6203269
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mark Pearson <mpearson@chromium.org>
Auto-Submit: Mark Pearson <mpearson@chromium.org>
Owners-Override: Mark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411949}
2025-01-27 15:42:09 -08:00
Erik Chen
1396bbe886 Add ban rule for anonymous namespaces in header files.
See discussion at
https://groups.google.com/a/chromium.org/g/chromium-dev/c/qgUGhXjCFrs/m/QoVu31ClDQAJ

Change-Id: Ie54f9614075402dda481d4ef74fad157510042f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6197921
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411947}
2025-01-27 15:39:36 -08:00
selya
ba1e976cd9 Add presubmit check to prevent anonymous namespace usage in headers
Bug: 391905435
Change-Id: I928d282bc3b626addc564889338cb7426e7cbe4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6192789
Commit-Queue: Aaron Selya <selya@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411842}
2025-01-27 12:55:25 -08:00
Andrew Grieve
5a66ae7641 Add a PRESUBMIT to ensure Robolectric tests use BaseRobolectricTestRunner
Bug: 383779576
Change-Id: Ica45a4591554acb2ff2f1c7f658185de0353ca5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6092006
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1395951}
2024-12-13 07:21:53 -08:00
Joanna Wang
130e7bdd6b PRESUBMIT: check if DEPS file is an existing file rather than path.
Bug: 382703190
Change-Id: I6fca194462fe20a4bd4dcd63a531970d91360c06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6081832
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1394373}
2024-12-10 17:39:03 +00:00
Andrew Grieve
b77ac76dd1 Make OWNERS review for added DEPS include_dirs opt-in
If review is required, DEPS files can add:

new_usages_require_review = True

Bug: 365797506
Change-Id: I3457e8d868fbf9715ce6ed4622d48a75c351c17a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910107
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1389797}
2024-11-29 15:01:48 +00:00
Mark Schillaci
44c90b4456 Add accessibility PRESUBMIT check for element attribute getters
This check will help stop a pattern that should not be used in the
accessibility code because it could bypass ElementInternals and give
incorrect results on custom elements.

AX-Relnotes: N/A
Bug: 372169467
Change-Id: I008c9433a22c9b6723da9e91b640390b86f4dade
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6036605
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Mark Schillaci <mschillaci@google.com>
Cr-Commit-Position: refs/heads/main@{#1387038}
2024-11-22 20:44:38 +00:00
Mark Schillaci
9c818545f9 Reduce noise of Android accessibility test PRESUBMIT
This CL fixes some tests to reduce the noise of an accessibility
PRESUBMIT, and moves these into a new PRESUBMIT.py file.

AX-Relnotes: N/A
Bug: 379843998
Change-Id: I142288de836c92234fadabcb9d66cc382415057d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6036252
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Mark Schillaci <mschillaci@google.com>
Cr-Commit-Position: refs/heads/main@{#1386935}
2024-11-22 18:14:22 +00:00
Theo Cristea
1d9a90af2d Remove obsolete UiThreadTest presubmit rules
The UiThreadTest files indicated to be used by the presubmit rule were
deleted here: http://crrev.com/c/5361254. The linked CL also mentions
that it is now safe to use the rules removed by this CL.

Bug: 40142780
Change-Id: I5de93074ce981dcc858d2e3c4bb969761e36bfe2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020063
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Commit-Queue: Theo Cristea <theocristea@google.com>
Cr-Commit-Position: refs/heads/main@{#1382897}
2024-11-14 13:31:30 +00:00
Georg Neis
94f87f04d2 ash: Adapt a presubmit check
The check prompted to add an assert(is_chromeos_ash) if not present.
Since we are going to remove is_chromeos_ash in favor of is_chromeos
(due to Lacros removal), change the check to allow both flags and
change the error message so that it mentions is_chromeos.

Also fix an issue in the tests. They were using mock files of the same
name, so only the first one was actually used.

Bug: 373971535
Change-Id: I0510a23df5fc61ac8d4327df1835f9c84bf64392
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5951185
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1371890}
2024-10-22 08:20:13 +00:00
Andrew Grieve
713b89b89f Reland : Improve mocking of os_path.exists() in PRESUBMIT_test.py
This reverts commit 58cf9bbd16.

Reason for reland: Fixed broken test

Original change's description:
> Revert "Reland "Improve mocking of os_path.exists() in PRESUBMIT_test.py""
>
> This reverts commit 3ba398ee58.
>
> Reason for revert: crbug.com/372313790
>
> Original change's description:
> > Reland "Improve mocking of os_path.exists() in PRESUBMIT_test.py"
> >
> > This reverts commit 74e5e087cb.
> >
> > Reason for reland: Fixed blink & webapk presubmit tests
> >
> > Original change's description:
> > > Revert "Improve mocking of os_path.exists() in PRESUBMIT_test.py"
> > >
> > > This reverts commit b35a9a9465.
> > >
> > > Reason for revert: Manual bisect shows that this is responsible for failures starting in https://ci.chromium.org/ui/p/chromium/builders/ci/linux-presubmit/19822/blamelist.  Local repro on Linux: `vpython3 chrome/android/webapk/PRESUBMIT_test.py --verbose`
> > >
> > > Original change's description:
> > > > Improve mocking of os_path.exists() in PRESUBMIT_test.py
> > > >
> > > > I need this for an upcoming change, but it turns out it found 2 real
> > > > bugs:
> > > >  * A .pydeps check that would never be hit due to test mocks returning
> > > >    that deleted files exist
> > > >  * A translations check that would never be hit due to test mocks using
> > > >    local paths when absolute paths were requested.
> > > >
> > > > Bug: None
> > > > Change-Id: I920e4f67b2ff1193b89c7abfd9664d14a94c44bf
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910106
> > > > Reviewed-by: Ted Choc <tedchoc@chromium.org>
> > > > Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> > > > Cr-Commit-Position: refs/heads/main@{#1364918}
> > >
> > > Bug: None
> > > Change-Id: Ibcc1931e5709d1a4209e56211595df8b94a35c9a
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5913697
> > > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > > Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
> > > Owners-Override: Łukasz Anforowicz <lukasza@chromium.org>
> > > Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#1364999}
> >
> > Bug: None
> > Change-Id: I303d4d1abc685e3bad854e9a5ebe8ae2efe48869
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5912982
> > Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> > Auto-Submit: Andrew Grieve <agrieve@chromium.org>
> > Reviewed-by: Ted Choc <tedchoc@chromium.org>
> > Owners-Override: Andrew Grieve <agrieve@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1365664}
>
> Bug: None
> Change-Id: Iaebc98243a14fff08442948fea4d69531f6103ee
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5918609
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Owners-Override: Sophey Dong <sophey@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Sophey Dong <sophey@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1365901}

Bug: None
Change-Id: I998b8bea9e513d24652ce3d92bf88f677c987538
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5921545
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1368995}
2024-10-15 20:20:08 +00:00
Sophey Dong
58cf9bbd16 Revert "Reland "Improve mocking of os_path.exists() in PRESUBMIT_test.py""
This reverts commit 3ba398ee58.

Reason for revert: crbug.com/372313790

Original change's description:
> Reland "Improve mocking of os_path.exists() in PRESUBMIT_test.py"
>
> This reverts commit 74e5e087cb.
>
> Reason for reland: Fixed blink & webapk presubmit tests
>
> Original change's description:
> > Revert "Improve mocking of os_path.exists() in PRESUBMIT_test.py"
> >
> > This reverts commit b35a9a9465.
> >
> > Reason for revert: Manual bisect shows that this is responsible for failures starting in https://ci.chromium.org/ui/p/chromium/builders/ci/linux-presubmit/19822/blamelist.  Local repro on Linux: `vpython3 chrome/android/webapk/PRESUBMIT_test.py --verbose`
> >
> > Original change's description:
> > > Improve mocking of os_path.exists() in PRESUBMIT_test.py
> > >
> > > I need this for an upcoming change, but it turns out it found 2 real
> > > bugs:
> > >  * A .pydeps check that would never be hit due to test mocks returning
> > >    that deleted files exist
> > >  * A translations check that would never be hit due to test mocks using
> > >    local paths when absolute paths were requested.
> > >
> > > Bug: None
> > > Change-Id: I920e4f67b2ff1193b89c7abfd9664d14a94c44bf
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910106
> > > Reviewed-by: Ted Choc <tedchoc@chromium.org>
> > > Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#1364918}
> >
> > Bug: None
> > Change-Id: Ibcc1931e5709d1a4209e56211595df8b94a35c9a
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5913697
> > Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
> > Owners-Override: Łukasz Anforowicz <lukasza@chromium.org>
> > Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1364999}
>
> Bug: None
> Change-Id: I303d4d1abc685e3bad854e9a5ebe8ae2efe48869
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5912982
> Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> Auto-Submit: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Ted Choc <tedchoc@chromium.org>
> Owners-Override: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1365664}

Bug: None
Change-Id: Iaebc98243a14fff08442948fea4d69531f6103ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5918609
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Sophey Dong <sophey@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Sophey Dong <sophey@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1365901}
2024-10-09 00:08:10 +00:00
Andrew Grieve
3ba398ee58 Reland "Improve mocking of os_path.exists() in PRESUBMIT_test.py"
This reverts commit 74e5e087cb.

Reason for reland: Fixed blink & webapk presubmit tests

Original change's description:
> Revert "Improve mocking of os_path.exists() in PRESUBMIT_test.py"
>
> This reverts commit b35a9a9465.
>
> Reason for revert: Manual bisect shows that this is responsible for failures starting in https://ci.chromium.org/ui/p/chromium/builders/ci/linux-presubmit/19822/blamelist.  Local repro on Linux: `vpython3 chrome/android/webapk/PRESUBMIT_test.py --verbose`
>
> Original change's description:
> > Improve mocking of os_path.exists() in PRESUBMIT_test.py
> >
> > I need this for an upcoming change, but it turns out it found 2 real
> > bugs:
> >  * A .pydeps check that would never be hit due to test mocks returning
> >    that deleted files exist
> >  * A translations check that would never be hit due to test mocks using
> >    local paths when absolute paths were requested.
> >
> > Bug: None
> > Change-Id: I920e4f67b2ff1193b89c7abfd9664d14a94c44bf
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910106
> > Reviewed-by: Ted Choc <tedchoc@chromium.org>
> > Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#1364918}
>
> Bug: None
> Change-Id: Ibcc1931e5709d1a4209e56211595df8b94a35c9a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5913697
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
> Owners-Override: Łukasz Anforowicz <lukasza@chromium.org>
> Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1364999}

Bug: None
Change-Id: I303d4d1abc685e3bad854e9a5ebe8ae2efe48869
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5912982
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1365664}
2024-10-08 17:34:50 +00:00
Łukasz Anforowicz
74e5e087cb Revert "Improve mocking of os_path.exists() in PRESUBMIT_test.py"
This reverts commit b35a9a9465.

Reason for revert: Manual bisect shows that this is responsible for failures starting in https://ci.chromium.org/ui/p/chromium/builders/ci/linux-presubmit/19822/blamelist.  Local repro on Linux: `vpython3 chrome/android/webapk/PRESUBMIT_test.py --verbose`

Original change's description:
> Improve mocking of os_path.exists() in PRESUBMIT_test.py
>
> I need this for an upcomping change, but it turns out it found 2 real
> bugs:
>  * A .pydeps check that would never be hit due to test mocks returning
>    that deleted files exist
>  * A translations check that would never be hit due to test mocks using
>    local paths when absolute paths were requested.
>
> Bug: None
> Change-Id: I920e4f67b2ff1193b89c7abfd9664d14a94c44bf
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910106
> Reviewed-by: Ted Choc <tedchoc@chromium.org>
> Commit-Queue: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1364918}

Bug: None
Change-Id: Ibcc1931e5709d1a4209e56211595df8b94a35c9a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5913697
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Owners-Override: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1364999}
2024-10-07 16:56:18 +00:00
Andrew Grieve
b35a9a9465 Improve mocking of os_path.exists() in PRESUBMIT_test.py
I need this for an upcomping change, but it turns out it found 2 real
bugs:
 * A .pydeps check that would never be hit due to test mocks returning
   that deleted files exist
 * A translations check that would never be hit due to test mocks using
   local paths when absolute paths were requested.

Bug: None
Change-Id: I920e4f67b2ff1193b89c7abfd9664d14a94c44bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5910106
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1364918}
2024-10-07 14:34:19 +00:00
Daniel Cheng
8971922e9c Allow most of <ranges> but explicitly ban views
Change-Id: I67befc6d5cc18ab3ce43e6e3a1ad68f8dba878fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5668999
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1323174}
2024-07-04 04:59:29 +00:00
Daniel Cheng
566634ff1d git cl format --python PRESUBMIT.py and PRESUBMIT_test.py
Skipping the presubmit, because ironically enough, PRESUBMIT.py and
PRESUBMIT_test.py trigger a number of pre-existing presubmit violations.

No-Presubmit: true
Change-Id: I9aabeb8496a0582d6cb92af90db4ef3b32f70b04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5668998
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321358}
2024-06-29 14:56:53 +00:00
Scott Lee
bf6a094494 Disable DEPS review enforcement for cross-repo DEPS
When a new DEP is added, the presubmit check enforces reviews from
the owner of the additional DEP. However, when the DEP is from another
repo, the enforcement becomes trickier especially it is from a different
host.

This patch disables the check if a newly added DEP is from a submodule.

Change-Id: Id7c2feac005c1c769313dedb254d5a0b641ff68b
Bug: 324496840
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5656359
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1320079}
2024-06-26 22:59:39 +00:00
Bartek Nowierski
49b1a4582d [BRP] Take a step towards enforcing raw_ptr/ref in Renderer code
We intend to exclude only a handful specific sub-directories (for perf
reasons). This CL removes the broad exclusions from the rewriter and
the enforcing clang plugin.

There is a risk that by the time the plugin rolls into Chromium,
someone will add a raw pointer, which will cause the plugin
to error out and block the roll-out. Therefore, add those broad
exclusions into BUILD.gn temporarily -- they'll be removed after
the plugin rolls, once we confirm that all pointers in those
directories are properly rewritten.

In other words, this CL doesn't change the clang plugin enforcement
behavior.

Bug: 40064499, 331846123
Change-Id: Ia95e8df846d167521a5ac43cc63e556002702ee9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5600329
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312344}
2024-06-08 00:24:35 +00:00
Bartek Nowierski
f9f1b6635c [BRP] Semi-automated T* -> raw_ptr<T> Renderer rewrite 'refresh'
This time we're allowing pointers in third_party/blink/public/web/, but also covering new ones that popped up under /renderer/

No performance regression has been observed on benchmarks:
https://pinpoint-dot-chromeperf.appspot.com/job/12b5674f810000
https://pinpoint-dot-chromeperf.appspot.com/job/15e0c119810000
https://pinpoint-dot-chromeperf.appspot.com/job/11a435cd810000
https://pinpoint-dot-chromeperf.appspot.com/job/128306a7810000

Bug: 40064499, 331846123
Change-Id: I0d5cb5cae26a084ba4ca9195e432858059b09ffd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5602549
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Owners-Override: Keishi Hattori <keishi@chromium.org>
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1311752}
2024-06-07 04:59:00 +00:00
Bret Sepulveda
0ca7bfbfb5 Revert "[PRESUBMIT] Check if files are written to a dep dir"
This reverts commit 367476a325.

Reason for revert: Causing presubmit bot failures. See b/345023320, or ask battre@ for more information.

Original change's description:
> [PRESUBMIT] Check if files are written to a dep dir
>
> No files should be written to a directory that's used by CIPD or GCS, as
> defined in DEPS. Git already doesn't allow files to be written to a
> directory that's a gitlink.
>
> Bug: 343199633
> Change-Id: Ica929b7c6e5ca84082f24343869014e9eccfde58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5578422
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1310264}

Bug: 343199633
Change-Id: Idab125b2a0e2a7c673927ba6be4627c7ecb3fbe6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5598862
Owners-Override: Bret Sepulveda <bsep@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1310492}
2024-06-05 08:50:42 +00:00
Josip Sokcevic
367476a325 [PRESUBMIT] Check if files are written to a dep dir
No files should be written to a directory that's used by CIPD or GCS, as
defined in DEPS. Git already doesn't allow files to be written to a
directory that's a gitlink.

Bug: 343199633
Change-Id: Ica929b7c6e5ca84082f24343869014e9eccfde58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5578422
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1310264}
2024-06-04 22:23:34 +00:00
Rasika Navarange
277cd66085 [Chrome Stdlib]: Support renaming of test data objects
Allow files to be renamed while keeping the same sha256.

The previous version of the presubmit fails when we try to do this as it checks that when a file is removed, the matching hash is also removed from the DEPS file. In the case of renaming the hash stays the same and we want to explicitly allow this.

Change-Id: Iedb384858d45f078b04740b2937650061af1d861
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5575129
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1309836}
2024-06-04 10:14:59 +00:00
Erik Chen
f58f7206c3 Add presubmits warnings for commonly misused functions.
Change-Id: I0b9c673dfcb13e29d4a384c39e1721cdb7c2d231
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5591890
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1309589}
2024-06-03 21:21:52 +00:00
Rasika Navarange
08e542168e [Chrome Stdlib] Move .sha256 files to separate directory from test data
We need to move the .sha256 files to a separate directory to the actual
test data. This is because Cog does not support contents of a directory
coming from multiple sources i.e. both Git and GCS. So we need a
separate directory for files coming from GCS from the files coming from
Git.

Change-Id: I16fee14405a2b4faee842e01dd1e94ed2ccf0eec
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5582049
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1308600}
2024-05-31 13:31:26 +00:00
Allen Bauer
5839eb218f Add PRESUBMIT warnings for WIDGET_OWNS_NATIVE_WIDGET and
NATIVE_WIDGET_OWNS_WIDGET

We are refactoring Views code with an eye towards changing the ownership model of widgets to CLIENT_OWNS_WIDGET as the only ownership model. This will warn developers when they are landing code using one of these two ownership models.


Change-Id: I77c8911d3ab5669fb6f148a650465c4f43e2d09b
Bug: 339619005
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5577858
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/main@{#1306988}
2024-05-28 20:20:06 +00:00
Lei Zhang
d84f951ae2 Make CheckForIncludeGuards() presubmit fire warning for incorrect #endif
Check headers to make sure the "#endif // GUARD" line matches the
"#if GUARD" line.

Change-Id: I9d11dc8cf42f4058bd3bb1cd9e27a3269251a301
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5577500
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1306964}
2024-05-28 19:43:30 +00:00
Rasika Navarange
c2d33d2eab Reland "[Chrome Stdlib] Use DEPS to download diff test data"
This is a reland of commit 6c8f992499

This reland adds the deps entry for chrome_5672_histograms.pftrace.gz
which was missing in the original CL, causing b/342182426 which caused
the original CL to be reverted.

Original change's description:
> [Chrome Stdlib] Use DEPS to download diff test data
>
> We want to download Perfetto test data via GCS dependencies in DEPS
> rather than Perfetto's test_data script. To make this change we:
>
> 1. Modify the test_data.py script to wrap
>    `upload_to_google_storage_first_class.py` instead of Perfetto's
>    `test_data` script.
> 2. Add a Presubmit check to ensure the .sha256 files are in sync with
>    the deps entries.
> 3. Update docs to give instructions for the new workflow
>
> Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
> Bug: 312895063
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Commit-Queue: Rasika Navarange <rasikan@google.com>
> Reviewed-by: Dominic Battre <battre@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1304407}

Bug: 312895063
Change-Id: I6bcd74324612e5c49ae59bee3f0b20f673d70b81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5562906
Reviewed-by: Dominic Battre <battre@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Cr-Commit-Position: refs/heads/main@{#1305095}
2024-05-23 15:19:02 +00:00
Rasika Navarange
303cdf240f Revert "[Chrome Stdlib] Use DEPS to download diff test data"
This reverts commit 6c8f992499.

Reason for revert: b/342182426

Original change's description:
> [Chrome Stdlib] Use DEPS to download diff test data
>
> We want to download Perfetto test data via GCS dependencies in DEPS
> rather than Perfetto's test_data script. To make this change we:
>
> 1. Modify the test_data.py script to wrap
>    `upload_to_google_storage_first_class.py` instead of Perfetto's
>    `test_data` script.
> 2. Add a Presubmit check to ensure the .sha256 files are in sync with
>    the deps entries.
> 3. Update docs to give instructions for the new workflow
>
> Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
> Bug: 312895063
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Commit-Queue: Rasika Navarange <rasikan@google.com>
> Reviewed-by: Dominic Battre <battre@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1304407}

Bug: 312895063
Change-Id: I07872d3e5bdc550a6795197d396c11dadbbd3a3d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5558666
Commit-Queue: Zachary Tan <tanzachary@chromium.org>
Auto-Submit: Rasika Navarange <rasikan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Zachary Tan <tanzachary@chromium.org>
Owners-Override: Zachary Tan <tanzachary@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1304506}
2024-05-22 16:44:43 +00:00
Rasika Navarange
6c8f992499 [Chrome Stdlib] Use DEPS to download diff test data
We want to download Perfetto test data via GCS dependencies in DEPS
rather than Perfetto's test_data script. To make this change we:

1. Modify the test_data.py script to wrap
   `upload_to_google_storage_first_class.py` instead of Perfetto's
   `test_data` script.
2. Add a Presubmit check to ensure the .sha256 files are in sync with
   the deps entries.
3. Update docs to give instructions for the new workflow

Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Dominic Battre <battre@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1304407}
2024-05-22 14:09:23 +00:00
Victor Hugo Vianna Silva
dbe815499a [android/ios/presubmit] Warn about deprecated sync consent predicates
Bug: 40066949
Change-Id: Ib3dda14f33c6bea7ffcd12b6f8803d6d1a5e4095
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5553534
Reviewed-by: Dominic Battre <battre@chromium.org>
Auto-Submit: Victor Vianna <victorvianna@google.com>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/main@{#1303675}
2024-05-21 11:09:15 +00:00
Glen Robertson
9142ffd708 Fix false-positive in unique_ptr presubmit check with mismatched <>
Presubmit was preventing upload of crrev.com/c/5534806 due to changed
line:
` std::unique_ptr<WebAppInstallInfo>>(`
being interpreted as a call to the unique_ptr constructor. IIUC this was
because the check only looks at the changed lines and missed the extra
">" indicating this was really part of a larger template expression.

Added a condition that suppresses the check when selected brackets are
mismatching (ie. number of < and > are not equal). Added tests for these
cases.

Change-Id: I260b7826eb1f55764a8a93b3402888afa5032eed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5538411
Reviewed-by: Dirk Pranke <dpranke@google.com>
Auto-Submit: Glen Robertson <glenrob@chromium.org>
Commit-Queue: Glen Robertson <glenrob@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301700}
2024-05-16 01:37:47 +00:00
Arthur Sonzogni
62e877adbf Use partition_alloc PA_BUILDFLAG(...) outside PA. #cleanup
This is an automated #cleanup patch.

Migrate:
- from  BUILDFLAG (legacy chromium macro)
- to PA_BUILDFLAG (new partition_alloc macro)

The first is going to be removed in favor of the second.

The previous patch modified every occurrences inside partition_alloc,
this one does the same, but outside of partition_alloc.

Follow-ups will:
- Update dawn.
- Update pdfium.

Bug: chromium:1508847
Change-Id: Icc3fa34ee376e5ae866e9d456c363cb4180d4a49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5490530
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1294381}
2024-04-30 16:09:43 +00:00
Alison Gale
d6b25fee68 Add presubmit to ensure only updated bug IDs are added to the codebase
I'm migrating all TODOs referencing bug IDs to the new issue tracker
ID numbers. To avoid backsliding, I'm adding this presubmit. This LSC
is documented at go/crbug-todo-migration.

Bug: 321899722
Change-Id: Ib2fdd299796bf89124d5419cf0908c7cf380fe29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5455308
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288678}
2024-04-17 13:59:04 +00:00
Ted Choc
f486e3fc74 Migrate getLastUsedRegularProfile from Profile -> ProfileManager.
Deprecated profile methods will be removed in a subsequent CL
to avoid late breaking conflicts.

Bug: 40254448
Change-Id: I6dddb9f9b78abe58a4f8c3f65b6dd7c1b7489595
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5304420
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1262058}
2024-02-17 05:37:03 +00:00
Andrew Grieve
685060f9dd Android: Remove support for junit3 tests
We moved to junit4 long ago.

Bug: 40693265
Change-Id: I3be7bd0681fdb55bc95d63dafebedfcd7e646d33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5288616
Reviewed-by: Haiyang Pan <hypan@google.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1260024}
2024-02-13 20:35:25 +00:00
Rainhard Findling
3cde3ef0b3 [presubmit] ICU syntax check: allow =2 and =3 cases
Manually add =2 and =3 numeric cases to the allowed syntax of the ICU
syntax presubmit check.

While a generic solution that recognizes all possible numeric cases
automatically would also fix this for the =4 case and above, this
solution here is simpler and seem sufficient, given that the vast
majority of strings use up to =3 (at this point there is a single =4
case in the codebase, and none above).

Fixed: 41495103
Change-Id: Ib945c640f94d139d90a0d06e67dff5099b50d788
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237281
Reviewed-by: Dominic Battre <battre@chromium.org>
Reviewed-by: Nicolas MacBeth <nicolasmacbeth@google.com>
Reviewed-by: Rainhard Findling <rainhard@chromium.org>
Commit-Queue: Rainhard Findling <rainhard@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1256306}
2024-02-05 18:40:32 +00:00
Peter Kasting
134e9e5c7b Lock down access to LayoutSuperclass<>() and verify protections.
It's not possible to enforce at compile-time that LayoutSuperclass<>()
is only called while a layout is being processed, so enforce that at
runtime instead, and verify that enforcement with a death test.

This also adds nocompile tests that verify the PassKey protections on
Layout().

As a result, it should be impossible to improperly Layout() directly
from tests, so the presubmits blocking that are removed.

Bug: 1521108
Change-Id: I8f7653c7bdcbbebe5e042310028b3f7de691614f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5259737
Reviewed-by: Dominic Battre <battre@chromium.org>
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1255197}
2024-02-01 19:23:39 +00:00
Andrew Grieve
d3a35d8b6e Revert "Remove outdated TAG length presubmit error"
This reverts commit 77e3d6fa3d.

Reason for revert: It's still useful to have a limit here.

Original change's description:
> Remove outdated TAG length presubmit error
>
> The tag length limitation only applies to API <= 25, and Chrome has a min
> API of 26:
> https://source.chromium.org/chromium/chromium/src/+/main:build/config/android/config.gni;l=70?q=min_sdk_version%20lang:gn&ss=chromium.
>
> Change-Id: I5c75e3db16f068d8e5c61f1611b927e81b43db68
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5147980
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Commit-Queue: Geoff Huang <geoffhuang@google.com>
> Auto-Submit: Geoff Huang <geoffhuang@google.com>
> Cr-Commit-Position: refs/heads/main@{#1240847}

Change-Id: I3de662e88047ebf6e24c7971e02cf6c481cff4f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5160549
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1242138}
2024-01-02 21:24:38 +00:00
Geoff Huang
77e3d6fa3d Remove outdated TAG length presubmit error
The tag length limitation only applies to API <= 25, and Chrome has a min
API of 26:
https://source.chromium.org/chromium/chromium/src/+/main:build/config/android/config.gni;l=70?q=min_sdk_version%20lang:gn&ss=chromium.

Change-Id: I5c75e3db16f068d8e5c61f1611b927e81b43db68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5147980
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Geoff Huang <geoffhuang@google.com>
Auto-Submit: Geoff Huang <geoffhuang@google.com>
Cr-Commit-Position: refs/heads/main@{#1240847}
2023-12-25 06:27:38 +00:00
Daniel Cheng
99f90e6b0c Revert "PRESUBMIT.py type annotation for MockFile {Old,New}Content"
This reverts commit a4d9b63b54.

Reason for revert: Breaks some presubmit builders; see crbug.com/1505878

Original change's description:
> PRESUBMIT.py type annotation for MockFile {Old,New}Content
>
> Using strings instead of a Sequence[str] is a common error. This
> prevented a bug in to be caught previously:
> https://chromium-review.googlesource.com/c/chromium/src/+/5012813
>
> Apparently, the same error was made ~50 times.
>
> Bug: chromium:1395297
> Change-Id: I7b580a57522742b0dbbbdbfc274aa3b8d63af789
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017939
> Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1230109}

Bug: chromium:1395297
Change-Id: Ieb9be89929908725944aefb247a9b418af0e0e8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5067065
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1230256}
2023-11-28 22:54:40 +00:00
Arthur Sonzogni
a4d9b63b54 PRESUBMIT.py type annotation for MockFile {Old,New}Content
Using strings instead of a Sequence[str] is a common error. This
prevented a bug in to be caught previously:
https://chromium-review.googlesource.com/c/chromium/src/+/5012813

Apparently, the same error was made ~50 times.

Bug: chromium:1395297
Change-Id: I7b580a57522742b0dbbbdbfc274aa3b8d63af789
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017939
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1230109}
2023-11-28 20:30:26 +00:00
Arthur Sonzogni
9eafd22a23 Fix CheckDanglingUntriaged in PRESUBMIT.py
Due to not having type check in python, both the implementation and the
test were assuming `OldContents()` and `NewContents()` to be string.
They are list of strings instead.

The function `count(str)` being defined on both, it was passing locally,
when I was using DanglingUntriaged on its own line.

Bug: chromium:1395297
Change-Id: I2b20e92e2dfd0054bb4b2c3630f35af20661bbdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5012813
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1222807}
2023-11-10 08:50:39 +00:00
Jan Keitel
77be75245a Add a presubmit check for non-inlined constexpr definitions in headers.
Non-inlined constexpr variable definitions in a header lead every file
that includes this header to create a separate copy of the constant.
There appears to be no upside, but potential downsides (larger binary
size, differing memory addresses when one expect them to be equal)
from that behavior.

This CL adds a PRESUBMIT warning for changed or modified non-inline
constexpr variable definitions in headers. The check excludes
a) definitions in .cc files (which should hopefully not be included)
b) static constexpr member definitions inside structs and classes,
   as these are implicitly inline.

Relevant links:
- https://groups.google.com/a/chromium.org/g/cxx/c/hmyGFD80ocE
  (includes a discussion of adding this check)
- https://abseil.io/tips/168

Trial CL to just replace all non-inline constexpr seems to make bots
happy (apart from presubmit checks):
https://chromium-review.googlesource.com/c/chromium/src/+/4708325

Bug: 1467190
Change-Id: I187cecc0cb0676ee0e5950a6791f15cba96cb19c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4710609
Reviewed-by: Dominic Battre <battre@chromium.org>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209049}
2023-10-12 20:40:49 +00:00