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

Side by Side Diff: content/test/content_browser_test_test.cc

Issue 2175933002: More aggressive IO asserts in content_browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use 1 less instance of ScopedAllowIO in DumpAccessibilityTestBase::RunTestForPlatform. Created 4 years, 4 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 | « content/renderer/dom_serializer_browsertest.cc ('k') | content/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/public/test/content_browser_test.h" 5 #include "content/public/test/content_browser_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/process/launch.h" 9 #include "base/process/launch.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "base/test/launcher/test_launcher.h" 12 #include "base/test/launcher/test_launcher.h"
13 #include "base/threading/thread_restrictions.h"
13 #include "base/threading/thread_task_runner_handle.h" 14 #include "base/threading/thread_task_runner_handle.h"
14 #include "build/build_config.h" 15 #include "build/build_config.h"
15 #include "content/public/browser/render_process_host.h" 16 #include "content/public/browser/render_process_host.h"
16 #include "content/public/browser/render_process_host_observer.h" 17 #include "content/public/browser/render_process_host_observer.h"
17 #include "content/public/browser/web_contents.h" 18 #include "content/public/browser/web_contents.h"
18 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
19 #include "content/public/test/browser_test_utils.h" 20 #include "content/public/test/browser_test_utils.h"
20 #include "content/public/test/content_browser_test_utils.h" 21 #include "content/public/test/content_browser_test_utils.h"
21 #include "content/public/test/test_launcher.h" 22 #include "content/public/test/test_launcher.h"
22 #include "content/public/test/test_utils.h" 23 #include "content/public/test/test_utils.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 73
73 // Tests that browser tests print the callstack when a child process crashes. 74 // Tests that browser tests print the callstack when a child process crashes.
74 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, RendererCrashCallStack) { 75 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, RendererCrashCallStack) {
75 #if defined(OS_WIN) 76 #if defined(OS_WIN)
76 // Matches the same condition in RouteStdioToConsole, which makes this test 77 // Matches the same condition in RouteStdioToConsole, which makes this test
77 // fail on XP. 78 // fail on XP.
78 if (base::win::GetVersion() < base::win::VERSION_VISTA) 79 if (base::win::GetVersion() < base::win::VERSION_VISTA)
79 return; 80 return;
80 #endif 81 #endif
81 82
83 base::ThreadRestrictions::ScopedAllowIO allow_io_for_temp_dir;
82 base::ScopedTempDir temp_dir; 84 base::ScopedTempDir temp_dir;
83 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 85 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
84 base::CommandLine new_test = 86 base::CommandLine new_test =
85 base::CommandLine(base::CommandLine::ForCurrentProcess()->GetProgram()); 87 base::CommandLine(base::CommandLine::ForCurrentProcess()->GetProgram());
86 new_test.AppendSwitchASCII(base::kGTestFilterFlag, 88 new_test.AppendSwitchASCII(base::kGTestFilterFlag,
87 "ContentBrowserTest.MANUAL_RendererCrash"); 89 "ContentBrowserTest.MANUAL_RendererCrash");
88 new_test.AppendSwitch(kRunManualTestsFlag); 90 new_test.AppendSwitch(kRunManualTestsFlag);
89 new_test.AppendSwitch(kSingleProcessTestsFlag); 91 new_test.AppendSwitch(kSingleProcessTestsFlag);
90 92
91 // Per https://www.chromium.org/developers/testing/addresssanitizer, there are 93 // Per https://www.chromium.org/developers/testing/addresssanitizer, there are
(...skipping 21 matching lines...) Expand all
113 << output; 115 << output;
114 } 116 }
115 } 117 }
116 118
117 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, MANUAL_BrowserCrash) { 119 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, MANUAL_BrowserCrash) {
118 CHECK(false); 120 CHECK(false);
119 } 121 }
120 122
121 // Tests that browser tests print the callstack on asserts. 123 // Tests that browser tests print the callstack on asserts.
122 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, BrowserCrashCallStack) { 124 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, BrowserCrashCallStack) {
125 base::ThreadRestrictions::ScopedAllowIO allow_io_for_temp_dir;
123 base::ScopedTempDir temp_dir; 126 base::ScopedTempDir temp_dir;
124 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 127 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
125 base::CommandLine new_test = 128 base::CommandLine new_test =
126 base::CommandLine(base::CommandLine::ForCurrentProcess()->GetProgram()); 129 base::CommandLine(base::CommandLine::ForCurrentProcess()->GetProgram());
127 new_test.AppendSwitchASCII(base::kGTestFilterFlag, 130 new_test.AppendSwitchASCII(base::kGTestFilterFlag,
128 "ContentBrowserTest.MANUAL_BrowserCrash"); 131 "ContentBrowserTest.MANUAL_BrowserCrash");
129 new_test.AppendSwitch(kRunManualTestsFlag); 132 new_test.AppendSwitch(kRunManualTestsFlag);
130 new_test.AppendSwitch(kSingleProcessTestsFlag); 133 new_test.AppendSwitch(kSingleProcessTestsFlag);
131 std::string output; 134 std::string output;
132 base::GetAppOutputAndError(new_test, &output); 135 base::GetAppOutputAndError(new_test, &output);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 183
181 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, NonNestableTask) { 184 IN_PROC_BROWSER_TEST_F(ContentBrowserTest, NonNestableTask) {
182 bool non_nested_task_ran = false; 185 bool non_nested_task_ran = false;
183 base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask( 186 base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask(
184 FROM_HERE, base::Bind(&CallbackChecker, &non_nested_task_ran)); 187 FROM_HERE, base::Bind(&CallbackChecker, &non_nested_task_ran));
185 content::RunAllPendingInMessageLoop(); 188 content::RunAllPendingInMessageLoop();
186 ASSERT_TRUE(non_nested_task_ran); 189 ASSERT_TRUE(non_nested_task_ran);
187 } 190 }
188 191
189 } // namespace content 192 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/dom_serializer_browsertest.cc ('k') | content/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698