Commit cfdc058c authored by Nicolas Ouellet-payeur's avatar Nicolas Ouellet-payeur Committed by Commit Bot

Reland "[Traffic Annotations] Run extractor.py on waterfall"

This is a reland of d9dbade3

Original change's description:
> [Traffic Annotations] Run extractor.py on waterfall
> 
> linux-annotator-rel and win-annotator-rel will now test traffic
> annotations with extractor.py, as well as the clang tool.
> 
> Also updates a traffic annotation in management_ui_handler.cc, since
> extractor.py doesn't understand #ifdefs. As a workaround, this
> CrOS-specific annotation is moved to a CrOS-only file.
> 
> TESTED=
>   Ran traffic_annotation_auditor_tests.py locally, excluding the
>   --no-filtering configs.
> 
> Bug: 966883
> Change-Id: I7848877f67635b50d8ce2a841019e49136a33b11
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692970
> Reviewed-by: Hector Carmona <hcarmona@chromium.org>
> Reviewed-by: Ramin Halavati <rhalavati@chromium.org>
> Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#675994}

Bug: 966883
Change-Id: I5d3275315565b0592c86feedb564fa5cbf154e4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761146Reviewed-by: default avatarRamin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688597}
parent 0cf12d83
...@@ -1219,6 +1219,8 @@ jumbo_split_static_library("ui") { ...@@ -1219,6 +1219,8 @@ jumbo_split_static_library("ui") {
"webui/management_ui.h", "webui/management_ui.h",
"webui/management_ui_handler.cc", "webui/management_ui_handler.cc",
"webui/management_ui_handler.h", "webui/management_ui_handler.h",
"webui/management_ui_handler_chromeos.cc",
"webui/management_ui_handler_chromeos.h",
"webui/media_router/media_router_internals_ui.cc", "webui/media_router/media_router_internals_ui.cc",
"webui/media_router/media_router_internals_ui.h", "webui/media_router/media_router_internals_ui.h",
"webui/media_router/media_router_internals_webui_message_handler.cc", "webui/media_router/media_router_internals_webui_message_handler.cc",
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "chrome/browser/chromeos/policy/status_uploader.h" #include "chrome/browser/chromeos/policy/status_uploader.h"
#include "chrome/browser/chromeos/policy/system_log_uploader.h" #include "chrome/browser/chromeos/policy/system_log_uploader.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/ui/webui/management_ui_handler_chromeos.h"
#include "chrome/grit/chromium_strings.h" #include "chrome/grit/chromium_strings.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
...@@ -579,29 +580,8 @@ void ManagementUIHandler::AsyncUpdateLogo() { ...@@ -579,29 +580,8 @@ void ManagementUIHandler::AsyncUpdateLogo() {
g_browser_process->platform_part()->browser_policy_connector_chromeos(); g_browser_process->platform_part()->browser_policy_connector_chromeos();
const auto url = connector->GetCustomerLogoURL(); const auto url = connector->GetCustomerLogoURL();
if (!url.empty() && GURL(url) != logo_url_) { if (!url.empty() && GURL(url) != logo_url_) {
net::NetworkTrafficAnnotationTag traffic_annotation = icon_fetcher_ = std::make_unique<BitmapFetcher>(
net::DefineNetworkTrafficAnnotation("management_ui_customer_logo", R"( GURL(url), this, GetManagementUICustomerLogoAnnotation());
semantics {
sender: "Management UI Handler"
description:
"Download organization logo for visualization on the "
"chrome://management page."
trigger:
"The user managed by organization that provides a company logo "
"in their GSuites account loads the chrome://management page."
data:
"Organization uploaded image URL."
destination: GOOGLE_OWNED_SERVICE
}
policy {
cookies_allowed: NO
setting:
"This feature cannot be disabled by settings, but it is only "
"triggered by a user action."
policy_exception_justification: "Not implemented."
})");
icon_fetcher_ =
std::make_unique<BitmapFetcher>(GURL(url), this, traffic_annotation);
icon_fetcher_->Init( icon_fetcher_->Init(
std::string(), net::URLRequest::NEVER_CLEAR_REFERRER, std::string(), net::URLRequest::NEVER_CLEAR_REFERRER,
net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES); net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES);
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/management_ui_handler_chromeos.h"
net::NetworkTrafficAnnotationTag GetManagementUICustomerLogoAnnotation() {
return net::DefineNetworkTrafficAnnotation("management_ui_customer_logo", R"(
semantics {
sender: "Management UI Handler"
description:
"Download organization logo for visualization on the "
"chrome://management page."
trigger:
"The user managed by organization that provides a company logo "
"in their GSuites account loads the chrome://management page."
data:
"Organization uploaded image URL."
destination: GOOGLE_OWNED_SERVICE
}
policy {
cookies_allowed: NO
setting:
"This feature cannot be disabled by settings, but it is only "
"triggered by a user action."
policy_exception_justification: "Not implemented."
})");
}
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_MANAGEMENT_UI_HANDLER_CHROMEOS_H_
#define CHROME_BROWSER_UI_WEBUI_MANAGEMENT_UI_HANDLER_CHROMEOS_H_
#include "net/traffic_annotation/network_traffic_annotation.h"
net::NetworkTrafficAnnotationTag GetManagementUICustomerLogoAnnotation();
#endif // CHROME_BROWSER_UI_WEBUI_MANAGEMENT_UI_HANDLER_CHROMEOS_H_
...@@ -54,7 +54,16 @@ class TrafficAnnotationTestsChecker(): ...@@ -54,7 +54,16 @@ class TrafficAnnotationTestsChecker():
configs = [ configs = [
["--test-only", "--error-resilient"], # Similar to trybot. ["--test-only", "--error-resilient"], # Similar to trybot.
["--test-only"], # Failing on any runtime error. ["--test-only"], # Failing on any runtime error.
["--test-only", "--no-filtering"] # Not using heuristic filtering. ["--test-only", "--no-filtering"], # Not using heuristic filtering.
[ # extractor.py.
"--test-only",
"--extractor-backend=python_script",
],
[ # extractor.py, no filtering.
"--test-only",
"--no-filtering",
"--extractor-backend=python_script",
],
] ]
self.last_result = None self.last_result = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment