OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/command_line.h" | |
6 #include "content/browser/frame_host/frame_tree.h" | 5 #include "content/browser/frame_host/frame_tree.h" |
7 #include "content/browser/frame_host/frame_tree_node.h" | 6 #include "content/browser/frame_host/frame_tree_node.h" |
8 #include "content/browser/renderer_host/render_view_host_impl.h" | 7 #include "content/browser/renderer_host/render_view_host_impl.h" |
9 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
10 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
11 #include "content/public/browser/notification_types.h" | 10 #include "content/public/browser/notification_types.h" |
12 #include "content/public/common/content_switches.h" | |
13 #include "content/public/common/url_constants.h" | 11 #include "content/public/common/url_constants.h" |
14 #include "content/public/test/browser_test_utils.h" | 12 #include "content/public/test/browser_test_utils.h" |
15 #include "content/public/test/content_browser_test.h" | 13 #include "content/public/test/content_browser_test.h" |
16 #include "content/public/test/content_browser_test_utils.h" | 14 #include "content/public/test/content_browser_test_utils.h" |
17 #include "content/public/test/test_navigation_observer.h" | 15 #include "content/public/test/test_navigation_observer.h" |
18 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
19 #include "content/shell/browser/shell.h" | 17 #include "content/shell/browser/shell.h" |
20 #include "content/test/content_browser_test_utils_internal.h" | 18 #include "content/test/content_browser_test_utils_internal.h" |
21 #include "net/dns/mock_host_resolver.h" | 19 #include "net/dns/mock_host_resolver.h" |
22 #include "net/test/embedded_test_server/embedded_test_server.h" | 20 #include "net/test/embedded_test_server/embedded_test_server.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // Close the original window. This should clear the new window's opener. | 310 // Close the original window. This should clear the new window's opener. |
313 shell()->Close(); | 311 shell()->Close(); |
314 EXPECT_EQ(nullptr, popup_root->opener()); | 312 EXPECT_EQ(nullptr, popup_root->opener()); |
315 } | 313 } |
316 | 314 |
317 class CrossProcessFrameTreeBrowserTest : public ContentBrowserTest { | 315 class CrossProcessFrameTreeBrowserTest : public ContentBrowserTest { |
318 public: | 316 public: |
319 CrossProcessFrameTreeBrowserTest() {} | 317 CrossProcessFrameTreeBrowserTest() {} |
320 | 318 |
321 void SetUpCommandLine(base::CommandLine* command_line) override { | 319 void SetUpCommandLine(base::CommandLine* command_line) override { |
322 command_line->AppendSwitch(switches::kSitePerProcess); | 320 IsolateAllSitesForTesting(command_line); |
323 } | 321 } |
324 | 322 |
325 void SetUpOnMainThread() override { | 323 void SetUpOnMainThread() override { |
326 host_resolver()->AddRule("*", "127.0.0.1"); | 324 host_resolver()->AddRule("*", "127.0.0.1"); |
327 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 325 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
328 SetupCrossSiteRedirector(embedded_test_server()); | 326 SetupCrossSiteRedirector(embedded_test_server()); |
329 } | 327 } |
330 | 328 |
331 private: | 329 private: |
332 DISALLOW_COPY_AND_ASSIGN(CrossProcessFrameTreeBrowserTest); | 330 DISALLOW_COPY_AND_ASSIGN(CrossProcessFrameTreeBrowserTest); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 GURL data_url("data:text/html,foo"); | 424 GURL data_url("data:text/html,foo"); |
427 NavigateFrameToURL(root->child_at(1), data_url); | 425 NavigateFrameToURL(root->child_at(1), data_url); |
428 | 426 |
429 // Navigating to a data URL should set a unique origin. This is represented | 427 // Navigating to a data URL should set a unique origin. This is represented |
430 // as "null" per RFC 6454. | 428 // as "null" per RFC 6454. |
431 EXPECT_EQ(root->child_at(1)->current_replication_state().origin.Serialize(), | 429 EXPECT_EQ(root->child_at(1)->current_replication_state().origin.Serialize(), |
432 "null"); | 430 "null"); |
433 } | 431 } |
434 | 432 |
435 } // namespace content | 433 } // namespace content |
OLD | NEW |