| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Returns a HistogramTester which observed the most recent call to | 54 // Returns a HistogramTester which observed the most recent call to |
| 55 // StartFetchAndWait(). | 55 // StartFetchAndWait(). |
| 56 base::HistogramTester* uma() { return uma_.get(); } | 56 base::HistogramTester* uma() { return uma_.get(); } |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 ~TestMemoryDetails() override {} | 59 ~TestMemoryDetails() override {} |
| 60 | 60 |
| 61 void OnDetailsAvailable() override { | 61 void OnDetailsAvailable() override { |
| 62 MetricsMemoryDetails::OnDetailsAvailable(); | 62 MetricsMemoryDetails::OnDetailsAvailable(); |
| 63 // Exit the loop initiated by StartFetchAndWait(). | 63 // Exit the loop initiated by StartFetchAndWait(). |
| 64 base::MessageLoop::current()->Quit(); | 64 base::MessageLoop::current()->QuitWhenIdle(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 scoped_ptr<base::HistogramTester> uma_; | 67 scoped_ptr<base::HistogramTester> uma_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(TestMemoryDetails); | 69 DISALLOW_COPY_AND_ASSIGN(TestMemoryDetails); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace | 72 } // namespace |
| 73 | 73 |
| 74 class SiteDetailsBrowserTest : public ExtensionBrowserTest { | 74 class SiteDetailsBrowserTest : public ExtensionBrowserTest { |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 ElementsAre(Bucket(2, 1))); | 766 ElementsAre(Bucket(2, 1))); |
| 767 EXPECT_THAT(details->uma()->GetAllSamples( | 767 EXPECT_THAT(details->uma()->GetAllSamples( |
| 768 "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), | 768 "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| 769 ElementsAre(Bucket(2, 1))); | 769 ElementsAre(Bucket(2, 1))); |
| 770 EXPECT_THAT(details->uma()->GetAllSamples( | 770 EXPECT_THAT(details->uma()->GetAllSamples( |
| 771 "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), | 771 "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| 772 ElementsAre(Bucket(2, 1))); | 772 ElementsAre(Bucket(2, 1))); |
| 773 | 773 |
| 774 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(2)); | 774 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(2)); |
| 775 } | 775 } |
| OLD | NEW |