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

Side by Side Diff: chrome/test/perf/mach_ports_performancetest.cc

Issue 2952163002: Remove InProcessBrowserTest::SetUpOnMainThread() calls. (Closed)
Patch Set: rebase Created 3 years, 5 months 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
« no previous file with comments | « chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <mach/mach.h> 5 #include <mach/mach.h>
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 12 matching lines...) Expand all
23 // the number of open ports. This is used to protect against leaking Mach ports, 23 // the number of open ports. This is used to protect against leaking Mach ports,
24 // which was the source of <http://crbug.com/105513>. 24 // which was the source of <http://crbug.com/105513>.
25 class MachPortsTest : public InProcessBrowserTest { 25 class MachPortsTest : public InProcessBrowserTest {
26 public: 26 public:
27 MachPortsTest() { 27 MachPortsTest() {
28 embedded_test_server()->ServeFilesFromSourceDirectory( 28 embedded_test_server()->ServeFilesFromSourceDirectory(
29 "data/mach_ports/moz"); 29 "data/mach_ports/moz");
30 } 30 }
31 31
32 void SetUpOnMainThread() override { 32 void SetUpOnMainThread() override {
33 InProcessBrowserTest::SetUpOnMainThread();
34 ASSERT_TRUE(embedded_test_server()->Start()); 33 ASSERT_TRUE(embedded_test_server()->Start());
35 } 34 }
36 35
37 void TearDown() override { 36 void TearDown() override {
38 std::string ports; 37 std::string ports;
39 for (std::vector<int>::iterator it = port_counts_.begin(); 38 for (std::vector<int>::iterator it = port_counts_.begin();
40 it != port_counts_.end(); ++it) { 39 it != port_counts_.end(); ++it) {
41 base::StringAppendF(&ports, "%d,", *it); 40 base::StringAppendF(&ports, "%d,", *it);
42 } 41 }
43 perf_test::PrintResultList("mach_ports", "", "", ports, "ports", true); 42 perf_test::PrintResultList("mach_ports", "", "", ports, "ports", true);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // Close each tab, recording the number of ports after each. Do not close the 103 // Close each tab, recording the number of ports after each. Do not close the
105 // last tab, which is about:blank. 104 // last tab, which is about:blank.
106 for (int i = 0; i < tab_count - 1; ++i) { 105 for (int i = 0; i < tab_count - 1; ++i) {
107 EXPECT_TRUE( 106 EXPECT_TRUE(
108 tab_strip_model->CloseWebContentsAt(0, TabStripModel::CLOSE_NONE)); 107 tab_strip_model->CloseWebContentsAt(0, TabStripModel::CLOSE_NONE));
109 RecordPortCount(); 108 RecordPortCount();
110 } 109 }
111 } 110 }
112 111
113 } // namespace 112 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698