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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2893233002: Network traffic annotation added to URLLoaderImpl. (Closed)
Patch Set: Comment addressed, Merged. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/site_per_process_browsertest.h" 5 #include "content/browser/site_per_process_browsertest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "content/public/test/test_utils.h" 73 #include "content/public/test/test_utils.h"
74 #include "content/shell/browser/shell.h" 74 #include "content/shell/browser/shell.h"
75 #include "content/test/content_browser_test_utils_internal.h" 75 #include "content/test/content_browser_test_utils_internal.h"
76 #include "ipc/ipc.mojom.h" 76 #include "ipc/ipc.mojom.h"
77 #include "ipc/ipc_security_test_util.h" 77 #include "ipc/ipc_security_test_util.h"
78 #include "mojo/public/cpp/bindings/strong_binding.h" 78 #include "mojo/public/cpp/bindings/strong_binding.h"
79 #include "net/dns/mock_host_resolver.h" 79 #include "net/dns/mock_host_resolver.h"
80 #include "net/test/embedded_test_server/embedded_test_server.h" 80 #include "net/test/embedded_test_server/embedded_test_server.h"
81 #include "net/test/embedded_test_server/http_request.h" 81 #include "net/test/embedded_test_server/http_request.h"
82 #include "net/test/embedded_test_server/http_response.h" 82 #include "net/test/embedded_test_server/http_response.h"
83 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
83 #include "testing/gmock/include/gmock/gmock.h" 84 #include "testing/gmock/include/gmock/gmock.h"
84 #include "testing/gtest/include/gtest/gtest.h" 85 #include "testing/gtest/include/gtest/gtest.h"
85 #include "third_party/WebKit/public/platform/WebFeaturePolicy.h" 86 #include "third_party/WebKit/public/platform/WebFeaturePolicy.h"
86 #include "third_party/WebKit/public/platform/WebInputEvent.h" 87 #include "third_party/WebKit/public/platform/WebInputEvent.h"
87 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" 88 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h"
88 #include "third_party/WebKit/public/web/WebSandboxFlags.h" 89 #include "third_party/WebKit/public/web/WebSandboxFlags.h"
89 #include "ui/display/display_switches.h" 90 #include "ui/display/display_switches.h"
90 #include "ui/display/screen.h" 91 #include "ui/display/screen.h"
91 #include "ui/events/base_event_utils.h" 92 #include "ui/events/base_event_utils.h"
92 #include "ui/events/event.h" 93 #include "ui/events/event.h"
(...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2403 class FailingLoadFactory : public mojom::URLLoaderFactory { 2404 class FailingLoadFactory : public mojom::URLLoaderFactory {
2404 public: 2405 public:
2405 FailingLoadFactory() {} 2406 FailingLoadFactory() {}
2406 ~FailingLoadFactory() override {} 2407 ~FailingLoadFactory() override {}
2407 2408
2408 void CreateLoaderAndStart(mojom::URLLoaderAssociatedRequest loader, 2409 void CreateLoaderAndStart(mojom::URLLoaderAssociatedRequest loader,
2409 int32_t routing_id, 2410 int32_t routing_id,
2410 int32_t request_id, 2411 int32_t request_id,
2411 uint32_t options, 2412 uint32_t options,
2412 const ResourceRequest& request, 2413 const ResourceRequest& request,
2413 mojom::URLLoaderClientPtr client) override { 2414 mojom::URLLoaderClientPtr client,
2415 const net::MutableNetworkTrafficAnnotationTag&
2416 traffic_annotation) override {
2414 new FailingURLLoaderImpl(std::move(client)); 2417 new FailingURLLoaderImpl(std::move(client));
2415 } 2418 }
2416 void SyncLoad(int32_t routing_id, 2419 void SyncLoad(int32_t routing_id,
2417 int32_t request_id, 2420 int32_t request_id,
2418 const ResourceRequest& request, 2421 const ResourceRequest& request,
2419 SyncLoadCallback callback) override {} 2422 SyncLoadCallback callback) override {}
2420 }; 2423 };
2421 } 2424 }
2422 2425
2423 // Ensure that a cross-site page ends up in the correct process when it 2426 // Ensure that a cross-site page ends up in the correct process when it
(...skipping 7767 matching lines...) Expand 10 before | Expand all | Expand 10 after
10191 // Go back again. This should go to foo.com. 10194 // Go back again. This should go to foo.com.
10192 { 10195 {
10193 TestNavigationObserver back_observer(web_contents()); 10196 TestNavigationObserver back_observer(web_contents());
10194 web_contents()->GetController().GoBack(); 10197 web_contents()->GetController().GoBack();
10195 back_observer.Wait(); 10198 back_observer.Wait();
10196 } 10199 }
10197 EXPECT_EQ(foo_url, web_contents()->GetMainFrame()->GetLastCommittedURL()); 10200 EXPECT_EQ(foo_url, web_contents()->GetMainFrame()->GetLastCommittedURL());
10198 } 10201 }
10199 10202
10200 } // namespace content 10203 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_fetch_dispatcher.cc ('k') | content/browser/webui/web_ui_url_loader_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698