Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: chrome/browser/site_details_browsertest.cc

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/tab_restore_browsertest.cc ('k') | chrome/browser/speech/speech_recognition_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698