| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 WebContents* web_contents = WebContents::FromRenderViewHost(*iter); | 62 WebContents* web_contents = WebContents::FromRenderViewHost(*iter); |
| 63 std::string url = web_contents->GetURL().spec(); | 63 std::string url = web_contents->GetURL().spec(); |
| 64 if (url.find(url_query) != std::string::npos) | 64 if (url.find(url_query) != std::string::npos) |
| 65 matching_views.push_back(*iter); | 65 matching_views.push_back(*iter); |
| 66 } | 66 } |
| 67 return matching_views; | 67 return matching_views; |
| 68 } | 68 } |
| 69 | 69 |
| 70 std::string ReadCurrentVersion() { | 70 std::string ReadCurrentVersion() { |
| 71 std::string response; | 71 std::string response; |
| 72 EXPECT_TRUE(file_util::ReadFileToString( | 72 EXPECT_TRUE(base::ReadFileToString( |
| 73 test_data_dir_.AppendASCII("gtalk").AppendASCII("current_version"), | 73 test_data_dir_.AppendASCII("gtalk").AppendASCII("current_version"), |
| 74 &response)); | 74 &response)); |
| 75 return response; | 75 return response; |
| 76 } | 76 } |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 std::string installed_extension_id_; | 79 std::string installed_extension_id_; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 IN_PROC_BROWSER_TEST_F(GtalkExtensionTest, InstallCurrent) { | 82 IN_PROC_BROWSER_TEST_F(GtalkExtensionTest, InstallCurrent) { |
| 83 content::WindowedNotificationObserver panel_loaded( | 83 content::WindowedNotificationObserver panel_loaded( |
| 84 chrome::NOTIFICATION_EXTENSION_VIEW_REGISTERED, | 84 chrome::NOTIFICATION_EXTENSION_VIEW_REGISTERED, |
| 85 content::NotificationService::AllSources()); | 85 content::NotificationService::AllSources()); |
| 86 InstallGtalkExtension(ReadCurrentVersion()); | 86 InstallGtalkExtension(ReadCurrentVersion()); |
| 87 panel_loaded.Wait(); | 87 panel_loaded.Wait(); |
| 88 ASSERT_TRUE(GetViewer()); | 88 ASSERT_TRUE(GetViewer()); |
| 89 } | 89 } |
| OLD | NEW |