| 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" | |
| 53 #include "components/user_manager/user_manager.h" | 52 #include "components/user_manager/user_manager.h" |
| 54 #endif | 53 #endif |
| 55 | 54 |
| 56 using content::WebContents; | 55 using content::WebContents; |
| 57 | 56 |
| 58 namespace { | 57 namespace { |
| 59 | 58 |
| 60 class ContextMenuBrowserTest : public InProcessBrowserTest { | 59 class ContextMenuBrowserTest : public InProcessBrowserTest { |
| 61 public: | 60 public: |
| 62 ContextMenuBrowserTest() {} | 61 ContextMenuBrowserTest() {} |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 menu->Init(); | 102 menu->Init(); |
| 104 return menu; | 103 return menu; |
| 105 } | 104 } |
| 106 | 105 |
| 107 Profile* CreateSecondaryProfile(int profile_num) { | 106 Profile* CreateSecondaryProfile(int profile_num) { |
| 108 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 107 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 109 base::FilePath profile_path = profile_manager->user_data_dir(); | 108 base::FilePath profile_path = profile_manager->user_data_dir(); |
| 110 #if defined(OS_CHROMEOS) | 109 #if defined(OS_CHROMEOS) |
| 111 std::string profile_name = base::StringPrintf("NewProfile%d", profile_num); | 110 std::string profile_name = base::StringPrintf("NewProfile%d", profile_num); |
| 112 user_manager::UserManager::Get()->UserLoggedIn( | 111 user_manager::UserManager::Get()->UserLoggedIn( |
| 113 AccountId::FromUserEmail( | 112 base::StringPrintf("user%d@test.com", profile_num), profile_name, |
| 114 base::StringPrintf("user%d@test.com", profile_num)), | 113 false); |
| 115 profile_name, false); | |
| 116 profile_path = profile_path.Append( | 114 profile_path = profile_path.Append( |
| 117 chromeos::ProfileHelper::GetUserProfileDir(profile_name).BaseName()); | 115 chromeos::ProfileHelper::GetUserProfileDir(profile_name).BaseName()); |
| 118 #else | 116 #else |
| 119 profile_path = profile_path.AppendASCII( | 117 profile_path = profile_path.AppendASCII( |
| 120 base::StringPrintf("New Profile %d", profile_num)); | 118 base::StringPrintf("New Profile %d", profile_num)); |
| 121 #endif | 119 #endif |
| 122 return profile_manager->GetProfile(profile_path); | 120 return profile_manager->GetProfile(profile_path); |
| 123 } | 121 } |
| 124 }; | 122 }; |
| 125 | 123 |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 IN_PROC_BROWSER_TEST_F(LoadImageBrowserTest, LoadImage) { | 803 IN_PROC_BROWSER_TEST_F(LoadImageBrowserTest, LoadImage) { |
| 806 static const char kValidImage[] = "files/load_image/image.png"; | 804 static const char kValidImage[] = "files/load_image/image.png"; |
| 807 SetupAndLoadImagePage(kValidImage); | 805 SetupAndLoadImagePage(kValidImage); |
| 808 AddLoadImageInterceptor(kValidImage); | 806 AddLoadImageInterceptor(kValidImage); |
| 809 AttemptLoadImage(); | 807 AttemptLoadImage(); |
| 810 interceptor_->WaitForRequests(1); | 808 interceptor_->WaitForRequests(1); |
| 811 EXPECT_EQ(1, interceptor_->num_requests()); | 809 EXPECT_EQ(1, interceptor_->num_requests()); |
| 812 } | 810 } |
| 813 | 811 |
| 814 } // namespace | 812 } // namespace |
| OLD | NEW |