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

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

Issue 2093413002: Re-enable two flaky tests that were disabled due to timeouts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | content/browser/utility_process_mojo_client_browsertest.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 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/image_decoder.h" 5 #include "chrome/browser/image_decoder.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/grit/generated_resources.h" 9 #include "chrome/grit/generated_resources.h"
10 #include "chrome/test/base/in_process_browser_test.h" 10 #include "chrome/test/base/in_process_browser_test.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 test_request.reset(); 236 test_request.reset();
237 runner->Run(); 237 runner->Run();
238 } 238 }
239 239
240 // Killing the utility process counts as a crash. Thus the request fails. 240 // Killing the utility process counts as a crash. Thus the request fails.
241 // If ImageDecoder did not handle the crash properly, the request never finishes 241 // If ImageDecoder did not handle the crash properly, the request never finishes
242 // and this test would hang. 242 // and this test would hang.
243 // Note: This test is inherently racy because KillProcessObserver lives on the 243 // Note: This test is inherently racy because KillProcessObserver lives on the
244 // UI thread but ImageDecoder does its work mainly on the IO thread. So the test 244 // UI thread but ImageDecoder does its work mainly on the IO thread. So the test
245 // checks for both possible valid outcomes. 245 // checks for both possible valid outcomes.
246 // 246 IN_PROC_BROWSER_TEST_F(ImageDecoderBrowserTest, StartAndKillProcess) {
247 // Flaky timeouts on Linux ASan / LSan, and on Mac. crbug.com/618206
248 #if (defined(ADDRESS_SANITIZER) || defined(LEAK_SANITIZER)) && defined(OS_LINUX)
249 #define MAYBE_StartAndKillProcess DISABLED_StartAndKillProcess
250 #elif defined(OS_MACOSX)
251 #define MAYBE_StartAndKillProcess DISABLED_StartAndKillProcess
252 #else
253 #define MAYBE_StartAndKillProcess StartAndKillProcess
254 #endif
255 IN_PROC_BROWSER_TEST_F(ImageDecoderBrowserTest, MAYBE_StartAndKillProcess) {
256 KillProcessObserver observer; 247 KillProcessObserver observer;
257 scoped_refptr<content::MessageLoopRunner> runner = 248 scoped_refptr<content::MessageLoopRunner> runner =
258 new content::MessageLoopRunner; 249 new content::MessageLoopRunner;
259 TestImageRequest test_request(runner->QuitClosure()); 250 TestImageRequest test_request(runner->QuitClosure());
260 ImageDecoder::Start(&test_request, GetValidPngString()); 251 ImageDecoder::Start(&test_request, GetValidPngString());
261 runner->Run(); 252 runner->Run();
262 if (!test_request.decode_succeeded()) { 253 if (!test_request.decode_succeeded()) {
263 // The UI thread won the race. Make sure the utility process did get killed. 254 // The UI thread won the race. Make sure the utility process did get killed.
264 EXPECT_TRUE(observer.did_kill()); 255 EXPECT_TRUE(observer.did_kill());
265 } 256 }
266 // Else the IO thread won the race and the image got decoded. Oh well. 257 // Else the IO thread won the race and the image got decoded. Oh well.
267 } 258 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/utility_process_mojo_client_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698