tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TestOpenClientDirectoryInfo.cpp (1250B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "gtest/gtest.h"
      8 #include "mozilla/dom/quota/OpenClientDirectoryInfo.h"
      9 
     10 namespace mozilla::dom::quota::test {
     11 
     12 TEST(DOM_Quota_OpenClientDirectoryInfo, BasicUsage)
     13 {
     14  OpenClientDirectoryInfo openClientDirectoryInfo;
     15 
     16  EXPECT_EQ(openClientDirectoryInfo.ClientDirectoryLockHandleCount(), 0u);
     17 
     18  openClientDirectoryInfo.IncreaseClientDirectoryLockHandleCount();
     19  EXPECT_EQ(openClientDirectoryInfo.ClientDirectoryLockHandleCount(), 1u);
     20 
     21  openClientDirectoryInfo.IncreaseClientDirectoryLockHandleCount();
     22  EXPECT_EQ(openClientDirectoryInfo.ClientDirectoryLockHandleCount(), 2u);
     23 
     24  openClientDirectoryInfo.DecreaseClientDirectoryLockHandleCount();
     25  EXPECT_EQ(openClientDirectoryInfo.ClientDirectoryLockHandleCount(), 1u);
     26 
     27  openClientDirectoryInfo.DecreaseClientDirectoryLockHandleCount();
     28  EXPECT_EQ(openClientDirectoryInfo.ClientDirectoryLockHandleCount(), 0u);
     29 }
     30 
     31 }  //  namespace mozilla::dom::quota::test