OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/site_details.h" | 5 #include "chrome/browser/site_details.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 ~SiteDetailsBrowserTest() override {} | 88 ~SiteDetailsBrowserTest() override {} |
89 | 89 |
90 void SetUpOnMainThread() override { | 90 void SetUpOnMainThread() override { |
91 host_resolver()->AddRule("*", "127.0.0.1"); | 91 host_resolver()->AddRule("*", "127.0.0.1"); |
92 | 92 |
93 // Add content/test/data so we can use cross_site_iframe_factory.html | 93 // Add content/test/data so we can use cross_site_iframe_factory.html |
94 base::FilePath test_data_dir; | 94 base::FilePath test_data_dir; |
95 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir)); | 95 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir)); |
96 embedded_test_server()->ServeFilesFromDirectory( | 96 embedded_test_server()->ServeFilesFromDirectory( |
97 test_data_dir.AppendASCII("content/test/data/")); | 97 test_data_dir.AppendASCII("content/test/data/")); |
98 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 98 ASSERT_TRUE(embedded_test_server()->Start()); |
99 } | 99 } |
100 | 100 |
101 // Create and install an extension that has a couple of web-accessible | 101 // Create and install an extension that has a couple of web-accessible |
102 // resources and, optionally, a background process. | 102 // resources and, optionally, a background process. |
103 const Extension* CreateExtension(const std::string& name, | 103 const Extension* CreateExtension(const std::string& name, |
104 bool has_background_process) { | 104 bool has_background_process) { |
105 scoped_ptr<TestExtensionDir> dir(new TestExtensionDir); | 105 scoped_ptr<TestExtensionDir> dir(new TestExtensionDir); |
106 | 106 |
107 DictionaryBuilder manifest; | 107 DictionaryBuilder manifest; |
108 manifest.Set("name", name) | 108 manifest.Set("name", name) |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 "SiteIsolation.IsolateAllSitesProcessCountEstimate"), | 878 "SiteIsolation.IsolateAllSitesProcessCountEstimate"), |
879 ElementsAre(Bucket(2, 1))); | 879 ElementsAre(Bucket(2, 1))); |
880 EXPECT_THAT(details->uma()->GetAllSamples( | 880 EXPECT_THAT(details->uma()->GetAllSamples( |
881 "SiteIsolation.IsolateAllSitesProcessCountLowerBound"), | 881 "SiteIsolation.IsolateAllSitesProcessCountLowerBound"), |
882 ElementsAre(Bucket(2, 1))); | 882 ElementsAre(Bucket(2, 1))); |
883 EXPECT_THAT(details->uma()->GetAllSamples( | 883 EXPECT_THAT(details->uma()->GetAllSamples( |
884 "SiteIsolation.IsolateAllSitesProcessCountNoLimit"), | 884 "SiteIsolation.IsolateAllSitesProcessCountNoLimit"), |
885 ElementsAre(Bucket(2, 1))); | 885 ElementsAre(Bucket(2, 1))); |
886 EXPECT_THAT(GetRenderProcessCount(), EqualsIfSitePerProcess(2)); | 886 EXPECT_THAT(GetRenderProcessCount(), EqualsIfSitePerProcess(2)); |
887 } | 887 } |
OLD | NEW |