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

Side by Side Diff: chrome/browser/devtools/devtools_sanity_browsertest.cc

Issue 2835233002: Fix integration tests in src/chrome and src/extensions so that we can turn on IO thread checks wi... (Closed)
Patch Set: ready for review Created 3 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/cancelable_callback.h" 11 #include "base/cancelable_callback.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/location.h" 15 #include "base/location.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/memory/ptr_util.h" 17 #include "base/memory/ptr_util.h"
18 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
19 #include "base/path_service.h" 19 #include "base/path_service.h"
20 #include "base/single_thread_task_runner.h" 20 #include "base/single_thread_task_runner.h"
21 #include "base/strings/string_number_conversions.h" 21 #include "base/strings/string_number_conversions.h"
22 #include "base/strings/string_util.h" 22 #include "base/strings/string_util.h"
23 #include "base/strings/utf_string_conversions.h" 23 #include "base/strings/utf_string_conversions.h"
24 #include "base/task_scheduler/post_task.h" 24 #include "base/task_scheduler/post_task.h"
25 #include "base/test/test_timeouts.h" 25 #include "base/test/test_timeouts.h"
26 #include "base/threading/thread_restrictions.h"
26 #include "base/threading/thread_task_runner_handle.h" 27 #include "base/threading/thread_task_runner_handle.h"
27 #include "build/build_config.h" 28 #include "build/build_config.h"
28 #include "chrome/browser/chrome_notification_types.h" 29 #include "chrome/browser/chrome_notification_types.h"
29 #include "chrome/browser/devtools/device/tcp_device_provider.h" 30 #include "chrome/browser/devtools/device/tcp_device_provider.h"
30 #include "chrome/browser/devtools/devtools_window_testing.h" 31 #include "chrome/browser/devtools/devtools_window_testing.h"
31 #include "chrome/browser/extensions/extension_apitest.h" 32 #include "chrome/browser/extensions/extension_apitest.h"
32 #include "chrome/browser/extensions/extension_browsertest.h" 33 #include "chrome/browser/extensions/extension_browsertest.h"
33 #include "chrome/browser/extensions/extension_service.h" 34 #include "chrome/browser/extensions/extension_service.h"
34 #include "chrome/browser/extensions/test_extension_dir.h" 35 #include "chrome/browser/extensions/test_extension_dir.h"
35 #include "chrome/browser/extensions/unpacked_installer.h" 36 #include "chrome/browser/extensions/unpacked_installer.h"
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 web_url.spec() + "'></iframe></body></html>"); 591 web_url.spec() + "'></iframe></body></html>");
591 592
592 // Install the extension. 593 // Install the extension.
593 return LoadExtensionFromPath(dir->UnpackedPath()); 594 return LoadExtensionFromPath(dir->UnpackedPath());
594 } 595 }
595 596
596 private: 597 private:
597 const Extension* GetExtensionByPath( 598 const Extension* GetExtensionByPath(
598 const extensions::ExtensionSet& extensions, 599 const extensions::ExtensionSet& extensions,
599 const base::FilePath& path) { 600 const base::FilePath& path) {
601 base::ThreadRestrictions::ScopedAllowIO allow_io;
600 base::FilePath extension_path = base::MakeAbsoluteFilePath(path); 602 base::FilePath extension_path = base::MakeAbsoluteFilePath(path);
601 EXPECT_TRUE(!extension_path.empty()); 603 EXPECT_TRUE(!extension_path.empty());
602 for (const scoped_refptr<const Extension>& extension : extensions) { 604 for (const scoped_refptr<const Extension>& extension : extensions) {
603 if (extension->path() == extension_path) { 605 if (extension->path() == extension_path) {
604 return extension.get(); 606 return extension.get();
605 } 607 }
606 } 608 }
607 return nullptr; 609 return nullptr;
608 } 610 }
609 611
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 RunTestFunction(window, "testWindowInitializedOnNavigateBack"); 2060 RunTestFunction(window, "testWindowInitializedOnNavigateBack");
2059 2061
2060 DevToolsWindowTesting::CloseDevToolsWindowSync(window); 2062 DevToolsWindowTesting::CloseDevToolsWindowSync(window);
2061 content::WebUIControllerFactory::UnregisterFactoryForTesting(&test_factory); 2063 content::WebUIControllerFactory::UnregisterFactoryForTesting(&test_factory);
2062 } 2064 }
2063 2065
2064 // Tests scripts panel showing. 2066 // Tests scripts panel showing.
2065 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestDevToolsSharedWorker) { 2067 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestDevToolsSharedWorker) {
2066 RunTest("testDevToolsSharedWorker", url::kAboutBlankURL); 2068 RunTest("testDevToolsSharedWorker", url::kAboutBlankURL);
2067 } 2069 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698