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

Unified Diff: net/quic/core/quic_protocol_test.cc

Issue 2306173003: Add a new QuicFlagSaver class for saving/restoring the values of QUIC flags in tests. (Closed)
Patch Set: Better Created 4 years, 3 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
« no previous file with comments | « net/quic/core/quic_packet_generator_test.cc ('k') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_protocol_test.cc
diff --git a/net/quic/core/quic_protocol_test.cc b/net/quic/core/quic_protocol_test.cc
index 21ea85ff5c6ab1b3cd14f6492af3e0aba04e36fd..3d31b022e64de51724464e6f33945cd412c0cf74 100644
--- a/net/quic/core/quic_protocol_test.cc
+++ b/net/quic/core/quic_protocol_test.cc
@@ -285,12 +285,7 @@ TEST(QuicProtocolTest, PathCloseFrameToString) {
}
TEST(QuicProtocolTest, FilterSupportedVersions) {
- ValueRestore<bool> old_v35_flag(&FLAGS_quic_enable_version_35,
- FLAGS_quic_enable_version_35);
- ValueRestore<bool> old_v36_flag(&FLAGS_quic_enable_version_36,
- FLAGS_quic_enable_version_36);
- ValueRestore<bool> old_v36_2_flag(&FLAGS_quic_enable_version_36_v2,
- FLAGS_quic_enable_version_36_v2);
+ QuicFlagSaver flags;
QuicVersionVector all_versions = {
QUIC_VERSION_30, QUIC_VERSION_31, QUIC_VERSION_32, QUIC_VERSION_33,
QUIC_VERSION_34, QUIC_VERSION_35, QUIC_VERSION_36};
@@ -307,10 +302,7 @@ TEST(QuicProtocolTest, FilterSupportedVersions) {
}
TEST(QuicProtocolTest, QuicVersionManager) {
- ValueRestore<bool> old_v35_flag(&FLAGS_quic_enable_version_35,
- FLAGS_quic_enable_version_35);
- ValueRestore<bool> old_v36_2_flag(&FLAGS_quic_enable_version_36_v2,
- FLAGS_quic_enable_version_36_v2);
+ QuicFlagSaver flags;
FLAGS_quic_enable_version_35 = false;
FLAGS_quic_enable_version_36_v2 = false;
QuicVersionManager manager(AllSupportedVersions());
« no previous file with comments | « net/quic/core/quic_packet_generator_test.cc ('k') | net/quic/core/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698