OLD | NEW |
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 <memory> | 5 #include <memory> |
6 #include "base/optional.h" | 6 #include "base/optional.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void SetUpOnMainThread() override { | 60 void SetUpOnMainThread() override { |
61 base::ThreadRestrictions::SetIOAllowed(true); | 61 base::ThreadRestrictions::SetIOAllowed(true); |
62 base::FilePath pak_path; | 62 base::FilePath pak_path; |
63 ASSERT_TRUE(PathService::Get(base::DIR_MODULE, &pak_path)); | 63 ASSERT_TRUE(PathService::Get(base::DIR_MODULE, &pak_path)); |
64 pak_path = pak_path.AppendASCII("headless_browser_tests.pak"); | 64 pak_path = pak_path.AppendASCII("headless_browser_tests.pak"); |
65 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 65 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
66 pak_path, ui::SCALE_FACTOR_NONE); | 66 pak_path, ui::SCALE_FACTOR_NONE); |
67 } | 67 } |
68 | 68 |
69 // HeadlessWebContentsObserver implementation: | 69 // HeadlessWebContents::Observer implementation: |
70 void DevToolsTargetReady() override { | 70 void DevToolsTargetReady() override { |
71 EXPECT_TRUE(web_contents_->GetDevToolsTarget()); | 71 EXPECT_TRUE(web_contents_->GetDevToolsTarget()); |
72 web_contents_->GetDevToolsTarget()->AttachClient(devtools_client_.get()); | 72 web_contents_->GetDevToolsTarget()->AttachClient(devtools_client_.get()); |
73 | 73 |
74 RunMojoTest(); | 74 RunMojoTest(); |
75 } | 75 } |
76 | 76 |
77 virtual void RunMojoTest() = 0; | 77 virtual void RunMojoTest() = 0; |
78 | 78 |
79 virtual GURL GetInitialUrl() const { return GURL("about:blank"); } | 79 virtual GURL GetInitialUrl() const { return GURL("about:blank"); } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 void DisableClientAndFinishAsynchronousTest() { | 248 void DisableClientAndFinishAsynchronousTest() { |
249 devtools_client_->GetNetwork()->Disable(); | 249 devtools_client_->GetNetwork()->Disable(); |
250 devtools_client_->GetNetwork()->RemoveObserver(this); | 250 devtools_client_->GetNetwork()->RemoveObserver(this); |
251 FinishAsynchronousTest(); | 251 FinishAsynchronousTest(); |
252 } | 252 } |
253 }; | 253 }; |
254 | 254 |
255 DEVTOOLS_CLIENT_TEST_F(HttpDisabledByDefaultWhenMojoBindingsUsed); | 255 DEVTOOLS_CLIENT_TEST_F(HttpDisabledByDefaultWhenMojoBindingsUsed); |
256 | 256 |
257 } // namespace headless | 257 } // namespace headless |
OLD | NEW |