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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 ~SiteDetailsBrowserTest() override {} | 78 ~SiteDetailsBrowserTest() override {} |
79 | 79 |
80 void SetUpOnMainThread() override { | 80 void SetUpOnMainThread() override { |
81 host_resolver()->AddRule("*", "127.0.0.1"); | 81 host_resolver()->AddRule("*", "127.0.0.1"); |
82 | 82 |
83 // Add content/test/data so we can use cross_site_iframe_factory.html | 83 // Add content/test/data so we can use cross_site_iframe_factory.html |
84 base::FilePath test_data_dir; | 84 base::FilePath test_data_dir; |
85 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir)); | 85 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir)); |
86 embedded_test_server()->ServeFilesFromDirectory( | 86 embedded_test_server()->ServeFilesFromDirectory( |
87 test_data_dir.AppendASCII("content/test/data/")); | 87 test_data_dir.AppendASCII("content/test/data/")); |
88 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 88 ASSERT_TRUE(embedded_test_server()->Start()); |
89 } | 89 } |
90 | 90 |
91 // Create and install an extension that has a couple of web-accessible | 91 // Create and install an extension that has a couple of web-accessible |
92 // resources and, optionally, a background process. | 92 // resources and, optionally, a background process. |
93 const Extension* CreateExtension(const std::string& name, | 93 const Extension* CreateExtension(const std::string& name, |
94 bool has_background_process) { | 94 bool has_background_process) { |
95 scoped_ptr<TestExtensionDir> dir(new TestExtensionDir); | 95 scoped_ptr<TestExtensionDir> dir(new TestExtensionDir); |
96 | 96 |
97 DictionaryBuilder manifest; | 97 DictionaryBuilder manifest; |
98 manifest.Set("name", name) | 98 manifest.Set("name", name) |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 "SiteIsolation.IsolateAllSitesProcessCountEstimate"), | 805 "SiteIsolation.IsolateAllSitesProcessCountEstimate"), |
806 ElementsAre(Bucket(2, 1))); | 806 ElementsAre(Bucket(2, 1))); |
807 EXPECT_THAT(details->uma()->GetAllSamples( | 807 EXPECT_THAT(details->uma()->GetAllSamples( |
808 "SiteIsolation.IsolateAllSitesProcessCountLowerBound"), | 808 "SiteIsolation.IsolateAllSitesProcessCountLowerBound"), |
809 ElementsAre(Bucket(2, 1))); | 809 ElementsAre(Bucket(2, 1))); |
810 EXPECT_THAT(details->uma()->GetAllSamples( | 810 EXPECT_THAT(details->uma()->GetAllSamples( |
811 "SiteIsolation.IsolateAllSitesProcessCountNoLimit"), | 811 "SiteIsolation.IsolateAllSitesProcessCountNoLimit"), |
812 ElementsAre(Bucket(2, 1))); | 812 ElementsAre(Bucket(2, 1))); |
813 EXPECT_THAT(GetRenderProcessCount(), EqualsIfSitePerProcess(2)); | 813 EXPECT_THAT(GetRenderProcessCount(), EqualsIfSitePerProcess(2)); |
814 } | 814 } |
OLD | NEW |