OLD | NEW |
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 "chrome_frame/test/net/fake_external_tab.h" | 5 #include "chrome_frame/test/net/fake_external_tab.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <atlcom.h> | 8 #include <atlcom.h> |
9 #include <exdisp.h> | 9 #include <exdisp.h> |
10 #include <Winsock2.h> | 10 #include <Winsock2.h> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "content/public/common/content_paths.h" | 68 #include "content/public/common/content_paths.h" |
69 #include "net/base/net_util.h" | 69 #include "net/base/net_util.h" |
70 #include "net/url_request/url_request_test_util.h" | 70 #include "net/url_request/url_request_test_util.h" |
71 #include "sandbox/win/src/sandbox_types.h" | 71 #include "sandbox/win/src/sandbox_types.h" |
72 #include "testing/gtest/include/gtest/gtest.h" | 72 #include "testing/gtest/include/gtest/gtest.h" |
73 #include "ui/base/resource/resource_bundle.h" | 73 #include "ui/base/resource/resource_bundle.h" |
74 #include "ui/base/resource/resource_bundle_win.h" | 74 #include "ui/base/resource/resource_bundle_win.h" |
75 #include "ui/base/ui_base_paths.h" | 75 #include "ui/base/ui_base_paths.h" |
76 | 76 |
77 #if defined(USE_AURA) | 77 #if defined(USE_AURA) |
| 78 #include "ui/aura/env.h" |
78 #include "ui/gfx/screen.h" | 79 #include "ui/gfx/screen.h" |
79 #include "ui/views/widget/desktop_aura/desktop_screen.h" | 80 #include "ui/views/widget/desktop_aura/desktop_screen.h" |
80 #endif | 81 #endif |
81 | 82 |
82 using content::BrowserThread; | 83 using content::BrowserThread; |
83 | 84 |
84 namespace { | 85 namespace { |
85 | 86 |
86 // We must store this globally so that our main delegate can set it. | 87 // We must store this globally so that our main delegate can set it. |
87 static CFUrlRequestUnittestRunner* g_test_suite = NULL; | 88 static CFUrlRequestUnittestRunner* g_test_suite = NULL; |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 scoped_refptr<PrefRegistrySimple> registry = static_cast<PrefRegistrySimple*>( | 547 scoped_refptr<PrefRegistrySimple> registry = static_cast<PrefRegistrySimple*>( |
547 browser_process_->local_state()->DeprecatedGetPrefRegistry()); | 548 browser_process_->local_state()->DeprecatedGetPrefRegistry()); |
548 if (!browser_process_->local_state()->FindPreference( | 549 if (!browser_process_->local_state()->FindPreference( |
549 prefs::kMetricsReportingEnabled)) { | 550 prefs::kMetricsReportingEnabled)) { |
550 registry->RegisterBooleanPref(prefs::kMetricsReportingEnabled, false); | 551 registry->RegisterBooleanPref(prefs::kMetricsReportingEnabled, false); |
551 } | 552 } |
552 } | 553 } |
553 | 554 |
554 void FakeExternalTab::InitializePostThreadsCreated() { | 555 void FakeExternalTab::InitializePostThreadsCreated() { |
555 #if defined(USE_AURA) | 556 #if defined(USE_AURA) |
| 557 aura::Env::CreateInstance(); |
556 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, | 558 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, |
557 views::CreateDesktopScreen()); | 559 views::CreateDesktopScreen()); |
558 #endif | 560 #endif |
559 base::FilePath profile_path( | 561 base::FilePath profile_path( |
560 profiles::GetDefaultProfileDir(user_data())); | 562 profiles::GetDefaultProfileDir(user_data())); |
561 Profile* profile = | 563 Profile* profile = |
562 g_browser_process->profile_manager()->GetProfile(profile_path); | 564 g_browser_process->profile_manager()->GetProfile(profile_path); |
563 } | 565 } |
564 | 566 |
565 void FakeExternalTab::Shutdown() { | 567 void FakeExternalTab::Shutdown() { |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 content::InitializeSandboxInfo(&sandbox_info); | 997 content::InitializeSandboxInfo(&sandbox_info); |
996 FakeMainDelegate delegate; | 998 FakeMainDelegate delegate; |
997 content::ContentMain( | 999 content::ContentMain( |
998 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), | 1000 reinterpret_cast<HINSTANCE>(GetModuleHandle(NULL)), |
999 &sandbox_info, | 1001 &sandbox_info, |
1000 &delegate); | 1002 &delegate); |
1001 | 1003 |
1002 // Note: In debug builds, we ExitProcess during PostDestroyThreads. | 1004 // Note: In debug builds, we ExitProcess during PostDestroyThreads. |
1003 return g_test_suite->test_result(); | 1005 return g_test_suite->test_result(); |
1004 } | 1006 } |
OLD | NEW |