2011-05-20 16:42:25 +02:00
|
|
|
// Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
|
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#ifndef CEF_TESTS_CEFCLIENT_UTIL_H_
|
|
|
|
#define CEF_TESTS_CEFCLIENT_UTIL_H_
|
|
|
|
#pragma once
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2011-12-23 18:36:30 +01:00
|
|
|
#include "include/cef_task.h"
|
2011-01-29 02:42:59 +01:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#if defined(OS_WIN)
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#include <windows.h> // NOLINT(build/include_order)
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#ifndef NDEBUG
|
2012-01-10 00:46:23 +01:00
|
|
|
#define ASSERT(condition) if (!(condition)) { DebugBreak(); }
|
2010-10-16 21:10:11 +02:00
|
|
|
#else
|
|
|
|
#define ASSERT(condition) ((void)0)
|
|
|
|
#endif
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#else // !OS_WIN
|
2010-11-15 16:39:56 +01:00
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#include <assert.h> // NOLINT(build/include_order)
|
2010-11-15 16:39:56 +01:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
#ifndef NDEBUG
|
2012-01-10 00:46:23 +01:00
|
|
|
#define ASSERT(condition) if (!(condition)) { assert(false); }
|
2010-11-15 16:39:56 +01:00
|
|
|
#else
|
|
|
|
#define ASSERT(condition) ((void)0)
|
|
|
|
#endif
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#endif // !OS_WIN
|
2010-10-16 21:10:11 +02:00
|
|
|
|
2011-01-29 02:42:59 +01:00
|
|
|
#define REQUIRE_UI_THREAD() ASSERT(CefCurrentlyOn(TID_UI));
|
|
|
|
#define REQUIRE_IO_THREAD() ASSERT(CefCurrentlyOn(TID_IO));
|
|
|
|
#define REQUIRE_FILE_THREAD() ASSERT(CefCurrentlyOn(TID_FILE));
|
|
|
|
|
2012-01-10 00:46:23 +01:00
|
|
|
#endif // CEF_TESTS_CEFCLIENT_UTIL_H_
|