blob: d45071e70c0f1c5a2b9b8df319753249d59ccc94 [file] [log] [blame]
// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <gtest/gtest.h>
#include "imageloader/global_context.h"
namespace imageloader {
TEST(GlobalContextTest, SetCurrent) {
GlobalContext g_ctx_1;
g_ctx_1.SetAsCurrent();
EXPECT_EQ(&g_ctx_1, GlobalContext::Current());
// To make sure the previous value was overriden.
GlobalContext g_ctx_2;
g_ctx_2.SetAsCurrent();
EXPECT_EQ(&g_ctx_2, GlobalContext::Current());
}
} // namespace imageloader