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

Side by Side Diff: components/timers/alarm_timer_unittest.cc

Issue 1585463002: Use sysroot for chromeos builds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « components/timers/alarm_timer_chromeos.cc ('k') | net/third_party/nss/ssl/BUILD.gn » ('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 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 <sys/timerfd.h> 5 #include <sys/timerfd.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 405
406 namespace { 406 namespace {
407 void TimerRanCallback(bool* did_run) { 407 void TimerRanCallback(bool* did_run) {
408 *did_run = true; 408 *did_run = true;
409 409
410 base::MessageLoop::current()->PostTask( 410 base::MessageLoop::current()->PostTask(
411 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); 411 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
412 } 412 }
413 413
414 bool IsAlarmTimerSupported() { 414 bool IsAlarmTimerSupported() {
415 #ifdef CLOCK_REALTIME_ALARM
415 int fd = timerfd_create(CLOCK_REALTIME_ALARM, 0); 416 int fd = timerfd_create(CLOCK_REALTIME_ALARM, 0);
417 #else
418 int fd = -1;
419 #endif
416 420
417 if (fd == -1) { 421 if (fd == -1) {
418 LOG(WARNING) << "CLOCK_REALTIME_ALARM is not supported on this system. " 422 LOG(WARNING) << "CLOCK_REALTIME_ALARM is not supported on this system. "
419 << "Skipping test. Upgrade to at least linux version 3.11 to " 423 << "Skipping test. Upgrade to at least linux version 3.11 to "
420 << "support this timer."; 424 << "support this timer.";
421 return false; 425 return false;
422 } 426 }
423 427
424 close(fd); 428 close(fd);
425 return true; 429 return true;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 if (!did_run) { 507 if (!did_run) {
504 base::RunLoop().Run(); 508 base::RunLoop().Run();
505 EXPECT_TRUE(did_run); 509 EXPECT_TRUE(did_run);
506 } 510 }
507 } 511 }
508 } 512 }
509 513
510 } // namespace 514 } // namespace
511 515
512 } // namespace timers 516 } // namespace timers
OLDNEW
« no previous file with comments | « components/timers/alarm_timer_chromeos.cc ('k') | net/third_party/nss/ssl/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698