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

Unified Diff: net/base/network_throttle_manager_unittest.cc

Issue 2130493002: Implement THROTTLED priority semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NetworkStreamThrottler
Patch Set: Incorporated final (? :-}) round of comments. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: net/base/network_throttle_manager_unittest.cc
diff --git a/net/base/network_throttle_manager_unittest.cc b/net/base/network_throttle_manager_unittest.cc
deleted file mode 100644
index c39a7a894fd4a97a904e3fa70b624b44364555f5..0000000000000000000000000000000000000000
--- a/net/base/network_throttle_manager_unittest.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2016 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.
-
-#include "net/base/network_throttle_manager.h"
-
-#include <memory>
-
-#include "net/base/request_priority.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace net {
-
-namespace {
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-class NetworkThrottleManagerTest : public testing::Test,
- NetworkThrottleManager::ThrottleDelegate {
- public:
- NetworkThrottleManagerTest()
- : throttler_(NetworkThrottleManager::CreateThrottler()) {}
-
- protected:
- std::unique_ptr<NetworkThrottleManager::Throttle> CreateThrottle(
- net::RequestPriority priority,
- bool expected_throttle_state) {
- std::unique_ptr<NetworkThrottleManager::Throttle> throttle(
- throttler_->CreateThrottle(this, priority, false));
- EXPECT_EQ(expected_throttle_state, throttle->IsThrottled());
- return throttle;
- }
-
- private:
- // NetworkThrottleManager::Delegate
- void OnThrottleStateChanged() override { ADD_FAILURE(); }
-
- std::unique_ptr<NetworkThrottleManager> throttler_;
-};
-
-// Check to confirm that all created throttles start unthrottled for the
-// current null implementation.
-TEST_F(NetworkThrottleManagerTest, AllUnthrottled) {
- for (int i = MINIMUM_PRIORITY; i <= MAXIMUM_PRIORITY; ++i) {
- CreateThrottle(static_cast<RequestPriority>(i), false);
- }
-}
-
-} // namespace
-
-} // namespace net

Powered by Google App Engine
This is Rietveld 408576698