OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/origin_trials/OriginTrialContext.h" | 5 #include "core/origin_trials/OriginTrialContext.h" |
6 | 6 |
7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
9 #include "core/dom/ExceptionCode.h" | 9 #include "core/dom/ExceptionCode.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 bool m_response; | 65 bool m_response; |
66 int m_callCount; | 66 int m_callCount; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(MockTokenValidator); | 68 DISALLOW_COPY_AND_ASSIGN(MockTokenValidator); |
69 }; | 69 }; |
70 | 70 |
71 // Concrete subclass of OriginTrialContext which simply maintains a vector of | 71 // Concrete subclass of OriginTrialContext which simply maintains a vector of |
72 // token strings to use for tests. | 72 // token strings to use for tests. |
73 class TestOriginTrialContext : public OriginTrialContext { | 73 class TestOriginTrialContext : public OriginTrialContext { |
74 public: | 74 public: |
75 explicit TestOriginTrialContext() | 75 TestOriginTrialContext() |
76 : m_parent(new NullExecutionContext()) | 76 : m_parent(new NullExecutionContext()) |
77 { | 77 { |
78 } | 78 } |
79 | 79 |
80 ~TestOriginTrialContext() override = default; | 80 ~TestOriginTrialContext() override = default; |
81 | 81 |
82 ExecutionContext* getExecutionContext() override { return m_parent.get(); } | 82 ExecutionContext* getExecutionContext() override { return m_parent.get(); } |
83 | 83 |
84 void addToken(const String& token) | 84 void addToken(const String& token) |
85 { | 85 { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 { | 261 { |
262 bool isOriginEnabled = isFeatureEnabledWithoutErrorMessage( | 262 bool isOriginEnabled = isFeatureEnabledWithoutErrorMessage( |
263 kFrobulateEnabledOriginUnsecure, | 263 kFrobulateEnabledOriginUnsecure, |
264 kFrobulateFeatureName, | 264 kFrobulateFeatureName, |
265 kGoodToken); | 265 kGoodToken); |
266 EXPECT_FALSE(isOriginEnabled); | 266 EXPECT_FALSE(isOriginEnabled); |
267 EXPECT_EQ(0, tokenValidator()->callCount()); | 267 EXPECT_EQ(0, tokenValidator()->callCount()); |
268 } | 268 } |
269 | 269 |
270 } // namespace blink | 270 } // namespace blink |
OLD | NEW |