OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "content/public/test/test_utils.h" | 42 #include "content/public/test/test_utils.h" |
43 #include "net/base/load_flags.h" | 43 #include "net/base/load_flags.h" |
44 #include "net/url_request/url_request.h" | 44 #include "net/url_request/url_request.h" |
45 #include "net/url_request/url_request_filter.h" | 45 #include "net/url_request/url_request_filter.h" |
46 #include "net/url_request/url_request_interceptor.h" | 46 #include "net/url_request/url_request_interceptor.h" |
47 #include "third_party/WebKit/public/web/WebContextMenuData.h" | 47 #include "third_party/WebKit/public/web/WebContextMenuData.h" |
48 #include "third_party/WebKit/public/web/WebInputEvent.h" | 48 #include "third_party/WebKit/public/web/WebInputEvent.h" |
49 | 49 |
50 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
51 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 51 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 52 #include "components/signin/core/account_id/account_id.h" |
52 #include "components/user_manager/user_manager.h" | 53 #include "components/user_manager/user_manager.h" |
53 #endif | 54 #endif |
54 | 55 |
55 using content::WebContents; | 56 using content::WebContents; |
56 | 57 |
57 namespace { | 58 namespace { |
58 | 59 |
59 class ContextMenuBrowserTest : public InProcessBrowserTest { | 60 class ContextMenuBrowserTest : public InProcessBrowserTest { |
60 public: | 61 public: |
61 ContextMenuBrowserTest() {} | 62 ContextMenuBrowserTest() {} |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 menu->Init(); | 103 menu->Init(); |
103 return menu; | 104 return menu; |
104 } | 105 } |
105 | 106 |
106 Profile* CreateSecondaryProfile(int profile_num) { | 107 Profile* CreateSecondaryProfile(int profile_num) { |
107 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 108 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
108 base::FilePath profile_path = profile_manager->user_data_dir(); | 109 base::FilePath profile_path = profile_manager->user_data_dir(); |
109 #if defined(OS_CHROMEOS) | 110 #if defined(OS_CHROMEOS) |
110 std::string profile_name = base::StringPrintf("NewProfile%d", profile_num); | 111 std::string profile_name = base::StringPrintf("NewProfile%d", profile_num); |
111 user_manager::UserManager::Get()->UserLoggedIn( | 112 user_manager::UserManager::Get()->UserLoggedIn( |
112 base::StringPrintf("user%d@test.com", profile_num), profile_name, | 113 AccountId::FromUserEmail( |
113 false); | 114 base::StringPrintf("user%d@test.com", profile_num)), |
| 115 profile_name, false); |
114 profile_path = profile_path.Append( | 116 profile_path = profile_path.Append( |
115 chromeos::ProfileHelper::GetUserProfileDir(profile_name).BaseName()); | 117 chromeos::ProfileHelper::GetUserProfileDir(profile_name).BaseName()); |
116 #else | 118 #else |
117 profile_path = profile_path.AppendASCII( | 119 profile_path = profile_path.AppendASCII( |
118 base::StringPrintf("New Profile %d", profile_num)); | 120 base::StringPrintf("New Profile %d", profile_num)); |
119 #endif | 121 #endif |
120 return profile_manager->GetProfile(profile_path); | 122 return profile_manager->GetProfile(profile_path); |
121 } | 123 } |
122 }; | 124 }; |
123 | 125 |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 IN_PROC_BROWSER_TEST_F(LoadImageBrowserTest, LoadImage) { | 805 IN_PROC_BROWSER_TEST_F(LoadImageBrowserTest, LoadImage) { |
804 static const char kValidImage[] = "files/load_image/image.png"; | 806 static const char kValidImage[] = "files/load_image/image.png"; |
805 SetupAndLoadImagePage(kValidImage); | 807 SetupAndLoadImagePage(kValidImage); |
806 AddLoadImageInterceptor(kValidImage); | 808 AddLoadImageInterceptor(kValidImage); |
807 AttemptLoadImage(); | 809 AttemptLoadImage(); |
808 interceptor_->WaitForRequests(1); | 810 interceptor_->WaitForRequests(1); |
809 EXPECT_EQ(1, interceptor_->num_requests()); | 811 EXPECT_EQ(1, interceptor_->num_requests()); |
810 } | 812 } |
811 | 813 |
812 } // namespace | 814 } // namespace |
OLD | NEW |