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

Side by Side Diff: third_party/WebKit/Source/core/page/FocusControllerTest.cpp

Issue 2970833002: Be explicit about namespace testing to not mix it with blink::testing (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/page/FocusController.h" 5 #include "core/page/FocusController.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "bindings/core/v8/V8BindingForCore.h" 8 #include "bindings/core/v8/V8BindingForCore.h"
9 #include "core/dom/ShadowRootInit.h" 9 #include "core/dom/ShadowRootInit.h"
10 #include "core/html/HTMLElement.h" 10 #include "core/html/HTMLElement.h"
11 #include "core/testing/DummyPageHolder.h" 11 #include "core/testing/DummyPageHolder.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class FocusControllerTest : public testing::Test { 16 class FocusControllerTest : public ::testing::Test {
17 public: 17 public:
18 Document& GetDocument() const { return page_holder_->GetDocument(); } 18 Document& GetDocument() const { return page_holder_->GetDocument(); }
19 FocusController& GetFocusController() const { 19 FocusController& GetFocusController() const {
20 return GetDocument().GetPage()->GetFocusController(); 20 return GetDocument().GetPage()->GetFocusController();
21 } 21 }
22 DummyPageHolder* PageHolder() const { return page_holder_.get(); } 22 DummyPageHolder* PageHolder() const { return page_holder_.get(); }
23 23
24 private: 24 private:
25 void SetUp() override { page_holder_ = DummyPageHolder::Create(); } 25 void SetUp() override { page_holder_ = DummyPageHolder::Create(); }
26 26
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 TEST_F(FocusControllerTest, SetActiveOnInactiveDocument) { 88 TEST_F(FocusControllerTest, SetActiveOnInactiveDocument) {
89 // Test for crbug.com/700334 89 // Test for crbug.com/700334
90 GetDocument().Shutdown(); 90 GetDocument().Shutdown();
91 // Document::shutdown() detaches document from its frame, and thus 91 // Document::shutdown() detaches document from its frame, and thus
92 // document().page() becomes nullptr. 92 // document().page() becomes nullptr.
93 // Use DummyPageHolder's page to retrieve FocusController. 93 // Use DummyPageHolder's page to retrieve FocusController.
94 PageHolder()->GetPage().GetFocusController().SetActive(true); 94 PageHolder()->GetPage().GetFocusController().SetActive(true);
95 } 95 }
96 96
97 } // namespace blink 97 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698