| 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/browser/extensions/extension_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
| 6 #include "chrome/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
| 7 #include "chrome/browser/extensions/extension_system.h" | 7 #include "chrome/browser/extensions/extension_system.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/common/extensions/extension.h" | |
| 11 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| 12 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
| 13 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
| 14 #include "content/public/test/browser_test_utils.h" | 13 #include "content/public/test/browser_test_utils.h" |
| 14 #include "extensions/common/extension.h" |
| 15 | 15 |
| 16 using extensions::Extension; | 16 using extensions::Extension; |
| 17 | 17 |
| 18 // Used to simulate a click on the first element named 'Options'. | 18 // Used to simulate a click on the first element named 'Options'. |
| 19 static const char kScriptClickOptionButton[] = | 19 static const char kScriptClickOptionButton[] = |
| 20 "(function() { " | 20 "(function() { " |
| 21 " var button = document.querySelector('.options-link');" | 21 " var button = document.querySelector('.options-link');" |
| 22 " button.click();" | 22 " button.click();" |
| 23 "})();"; | 23 "})();"; |
| 24 | 24 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 47 EXPECT_TRUE(content::ExecuteScriptInFrame( | 47 EXPECT_TRUE(content::ExecuteScriptInFrame( |
| 48 tab_strip->GetActiveWebContents(), | 48 tab_strip->GetActiveWebContents(), |
| 49 "//iframe[starts-with(@src, 'chrome://extension')]", | 49 "//iframe[starts-with(@src, 'chrome://extension')]", |
| 50 kScriptClickOptionButton)); | 50 kScriptClickOptionButton)); |
| 51 observer.Wait(); | 51 observer.Wait(); |
| 52 EXPECT_EQ(2, tab_strip->count()); | 52 EXPECT_EQ(2, tab_strip->count()); |
| 53 | 53 |
| 54 EXPECT_EQ(extension->GetResourceURL("options.html"), | 54 EXPECT_EQ(extension->GetResourceURL("options.html"), |
| 55 tab_strip->GetWebContentsAt(1)->GetURL()); | 55 tab_strip->GetWebContentsAt(1)->GetURL()); |
| 56 } | 56 } |
| OLD | NEW |