Chromium Code Reviews| 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 685 ElementsAre(Bucket(2, 1))); | 685 ElementsAre(Bucket(2, 1))); |
| 686 EXPECT_THAT(details->uma()->GetAllSamples( | 686 EXPECT_THAT(details->uma()->GetAllSamples( |
| 687 "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), | 687 "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| 688 ElementsAre(Bucket(2, 1))); | 688 ElementsAre(Bucket(2, 1))); |
| 689 // TODO(nick): https://crbug.com/512560 Make the number below agree with the | 689 // TODO(nick): https://crbug.com/512560 Make the number below agree with the |
| 690 // estimates above, which assume consolidation of subframe processes. | 690 // estimates above, which assume consolidation of subframe processes. |
| 691 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(3)); | 691 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(3)); |
| 692 } | 692 } |
| 693 | 693 |
| 694 // TODO(nick): This test demonstrates that --isolate-extensions currently | 694 // TODO(nick): This test demonstrates that --isolate-extensions currently |
| 695 // isolates hosted apps too. It shouldn't. http://crbug.com/535073 | 695 // isolates hosted apps too. It shouldn't. http://crbug.com/535073 |
|
Charlie Reis
2015/10/12 23:13:28
Don't forget to update this comment.
ncarter (slow)
2015/10/13 20:22:11
Done.
| |
| 696 IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { | 696 IN_PROC_BROWSER_TEST_F(SiteDetailsBrowserTest, IsolateExtensionsHostedApps) { |
| 697 GURL app_with_web_iframe_url = embedded_test_server()->GetURL( | 697 GURL app_with_web_iframe_url = embedded_test_server()->GetURL( |
| 698 "app.org", "/cross_site_iframe_factory.html?app.org(b.com)"); | 698 "app.org", "/cross_site_iframe_factory.html?app.org(b.com)"); |
| 699 GURL app_in_web_iframe_url = embedded_test_server()->GetURL( | 699 GURL app_in_web_iframe_url = embedded_test_server()->GetURL( |
| 700 "b.com", "/cross_site_iframe_factory.html?b.com(app.org)"); | 700 "b.com", "/cross_site_iframe_factory.html?b.com(app.org)"); |
| 701 | 701 |
| 702 // No hosted app is installed: app.org just behaves like a normal domain. | 702 // No hosted app is installed: app.org just behaves like a normal domain. |
| 703 ui_test_utils::NavigateToURL(browser(), app_with_web_iframe_url); | 703 ui_test_utils::NavigateToURL(browser(), app_with_web_iframe_url); |
| 704 scoped_refptr<TestMemoryDetails> details = new TestMemoryDetails(); | 704 scoped_refptr<TestMemoryDetails> details = new TestMemoryDetails(); |
| 705 details->StartFetchAndWait(); | 705 details->StartFetchAndWait(); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 730 "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), | 730 "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| 731 ElementsAre(Bucket(1, 1))); | 731 ElementsAre(Bucket(1, 1))); |
| 732 EXPECT_THAT(details->uma()->GetAllSamples( | 732 EXPECT_THAT(details->uma()->GetAllSamples( |
| 733 "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), | 733 "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| 734 ElementsAre(Bucket(1, 1))); | 734 ElementsAre(Bucket(1, 1))); |
| 735 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(1)); | 735 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(1)); |
| 736 | 736 |
| 737 // Now install app.org as a hosted app. | 737 // Now install app.org as a hosted app. |
| 738 CreateHostedApp("App", GURL("http://app.org")); | 738 CreateHostedApp("App", GURL("http://app.org")); |
| 739 | 739 |
| 740 // Reload the same two pages. | 740 // Reload the same two pages. |
|
Charlie Reis
2015/10/12 23:13:28
...and verify that the hosted app still is not iso
ncarter (slow)
2015/10/13 20:22:11
Done. Thanks for asking about this -- I actually t
Charlie Reis
2015/10/13 21:20:04
Nice, thanks!
| |
| 741 ui_test_utils::NavigateToURL(browser(), app_with_web_iframe_url); | 741 ui_test_utils::NavigateToURL(browser(), app_with_web_iframe_url); |
| 742 details = new TestMemoryDetails(); | 742 details = new TestMemoryDetails(); |
| 743 details->StartFetchAndWait(); | 743 details->StartFetchAndWait(); |
| 744 EXPECT_THAT(details->uma()->GetAllSamples( | 744 EXPECT_THAT(details->uma()->GetAllSamples( |
| 745 "SiteIsolation.CurrentRendererProcessCount"), | 745 "SiteIsolation.CurrentRendererProcessCount"), |
| 746 ElementsAre(Bucket(1, 1))); | 746 ElementsAre(Bucket(1, 1))); |
| 747 EXPECT_THAT(details->uma()->GetAllSamples( | 747 EXPECT_THAT(details->uma()->GetAllSamples( |
| 748 "SiteIsolation.IsolateExtensionsProcessCountEstimate"), | 748 "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| 749 ElementsAre(Bucket(2, 1))); | 749 ElementsAre(Bucket(1, 1))); |
| 750 EXPECT_THAT(details->uma()->GetAllSamples( | 750 EXPECT_THAT(details->uma()->GetAllSamples( |
| 751 "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), | 751 "SiteIsolation.IsolateExtensionsProcessCountLowerBound"), |
| 752 ElementsAre(Bucket(2, 1))); | 752 ElementsAre(Bucket(1, 1))); |
| 753 EXPECT_THAT(details->uma()->GetAllSamples( | 753 EXPECT_THAT(details->uma()->GetAllSamples( |
| 754 "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), | 754 "SiteIsolation.IsolateExtensionsProcessCountNoLimit"), |
| 755 ElementsAre(Bucket(2, 1))); | 755 ElementsAre(Bucket(1, 1))); |
| 756 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(2)); | 756 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(1)); |
| 757 | 757 |
| 758 ui_test_utils::NavigateToURL(browser(), app_in_web_iframe_url); | 758 ui_test_utils::NavigateToURL(browser(), app_in_web_iframe_url); |
| 759 details = new TestMemoryDetails(); | 759 details = new TestMemoryDetails(); |
| 760 details->StartFetchAndWait(); | 760 details->StartFetchAndWait(); |
| 761 EXPECT_THAT(details->uma()->GetAllSamples( | 761 EXPECT_THAT(details->uma()->GetAllSamples( |
| 762 "SiteIsolation.CurrentRendererProcessCount"), | 762 "SiteIsolation.CurrentRendererProcessCount"), |
| 763 ElementsAre(Bucket(1, 1))); | 763 ElementsAre(Bucket(1, 1))); |
| 764 EXPECT_THAT(details->uma()->GetAllSamples( | 764 EXPECT_THAT(details->uma()->GetAllSamples( |
| 765 "SiteIsolation.IsolateExtensionsProcessCountEstimate"), | 765 "SiteIsolation.IsolateExtensionsProcessCountEstimate"), |
| 766 ElementsAre(Bucket(2, 1))); | 766 ElementsAre(Bucket(1, 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(1, 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(1, 1))); |
| 773 | 773 |
| 774 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(2)); | 774 EXPECT_THAT(GetRenderProcessCount(), EqualsIfExtensionsIsolated(1)); |
| 775 } | 775 } |
| OLD | NEW |