Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Unified Diff: net/nqe/throughput_analyzer_unittest.cc

Issue 2833983002: Test network annotation tags added to unittests in net/. (Closed)
Patch Set: One file moved. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/nqe/throughput_analyzer_unittest.cc
diff --git a/net/nqe/throughput_analyzer_unittest.cc b/net/nqe/throughput_analyzer_unittest.cc
index 4e5eb762b177fc77fa390e64a8d269448c45c98e..3792700d53e0757a3f6c5013205847ce432708e6 100644
--- a/net/nqe/throughput_analyzer_unittest.cc
+++ b/net/nqe/throughput_analyzer_unittest.cc
@@ -17,6 +17,7 @@
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/base/url_util.h"
+#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -92,7 +93,8 @@ TEST(ThroughputAnalyzerTest, MaximumRequests) {
: "http://example.com/test.html";
for (size_t i = 0; i < 1000; ++i) {
std::unique_ptr<URLRequest> request(
- context.CreateRequest(GURL(url), DEFAULT_PRIORITY, &test_delegate));
+ context.CreateRequest(GURL(url), DEFAULT_PRIORITY, &test_delegate,
+ TRAFFIC_ANNOTATION_FOR_TESTS));
ASSERT_EQ(test.use_local_requests, IsLocalhost(request->url().host()));
throughput_analyzer.NotifyStartTransaction(*(request.get()));
@@ -133,14 +135,15 @@ TEST(ThroughputAnalyzerTest, TestThroughputWithMultipleRequestsOverlap) {
std::unique_ptr<URLRequest> request_local;
- std::unique_ptr<URLRequest> request_not_local(
- context.CreateRequest(GURL("http://example.com/echo.html"),
- DEFAULT_PRIORITY, &test_delegate));
+ std::unique_ptr<URLRequest> request_not_local(context.CreateRequest(
+ GURL("http://example.com/echo.html"), DEFAULT_PRIORITY, &test_delegate,
+ TRAFFIC_ANNOTATION_FOR_TESTS));
request_not_local->Start();
if (test.start_local_request) {
request_local = context.CreateRequest(GURL("http://localhost/echo.html"),
- DEFAULT_PRIORITY, &test_delegate);
+ DEFAULT_PRIORITY, &test_delegate,
+ TRAFFIC_ANNOTATION_FOR_TESTS);
request_local->Start();
}
@@ -203,9 +206,11 @@ TEST(ThroughputAnalyzerTest, TestThroughputWithNetworkRequestsOverlap) {
EXPECT_EQ(0, throughput_analyzer.throughput_observations_received());
std::unique_ptr<URLRequest> request_network_1 = context.CreateRequest(
- GURL("http://example.com/echo.html"), DEFAULT_PRIORITY, &test_delegate);
+ GURL("http://example.com/echo.html"), DEFAULT_PRIORITY, &test_delegate,
+ TRAFFIC_ANNOTATION_FOR_TESTS);
std::unique_ptr<URLRequest> request_network_2 = context.CreateRequest(
- GURL("http://example.com/echo.html"), DEFAULT_PRIORITY, &test_delegate);
+ GURL("http://example.com/echo.html"), DEFAULT_PRIORITY, &test_delegate,
+ TRAFFIC_ANNOTATION_FOR_TESTS);
request_network_1->Start();
request_network_2->Start();
« no previous file with comments | « net/nqe/network_quality_estimator_unittest.cc ('k') | net/quic/chromium/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698