// Copyright (c) 2011 The Chromium Authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file.// Tests of CancellationFlag class.#include "base/synchronization/cancellation_flag.h"#include "base/bind.h"#include "base/logging.h"#include "base/synchronization/spin_wait.h"#include "base/time/time.h"#include <gtest/gtest.h>namespacebase{namespace{TEST(CancellationFlagTest,SimpleSingleThreadedTest){CancellationFlagflag;ASSERT_FALSE(flag.IsSet());flag.Set();ASSERT_TRUE(flag.IsSet());}TEST(CancellationFlagTest,DoubleSetTest){CancellationFlagflag;ASSERT_FALSE(flag.IsSet());flag.Set();ASSERT_TRUE(flag.IsSet());flag.Set();ASSERT_TRUE(flag.IsSet());}}// namespace}// namespace base