| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/extensions/extension_message_bubble_browsertest.h" | 5 #include "chrome/browser/ui/extensions/extension_message_bubble_browsertest.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "chrome/browser/extensions/extension_action_test_util.h" | 9 #include "chrome/browser/extensions/extension_action_test_util.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 extension_service()->AddExtension(action_extension.get()); | 46 extension_service()->AddExtension(action_extension.get()); |
| 47 | 47 |
| 48 Browser* second_browser = new Browser(Browser::CreateParams(profile())); | 48 Browser* second_browser = new Browser(Browser::CreateParams(profile())); |
| 49 base::RunLoop().RunUntilIdle(); | 49 base::RunLoop().RunUntilIdle(); |
| 50 | 50 |
| 51 CheckBubble(second_browser, ANCHOR_BROWSER_ACTION); | 51 CheckBubble(second_browser, ANCHOR_BROWSER_ACTION); |
| 52 CloseBubble(second_browser); | 52 CloseBubble(second_browser); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void ExtensionMessageBubbleBrowserTest::TestBubbleAnchoredToAppMenu() { | 55 void ExtensionMessageBubbleBrowserTest::TestBubbleAnchoredToAppMenu() { |
| 56 LOG(WARNING) << "Anchored to app"; |
| 56 scoped_refptr<const extensions::Extension> no_action_extension = | 57 scoped_refptr<const extensions::Extension> no_action_extension = |
| 57 extensions::extension_action_test_util::CreateActionExtension( | 58 extensions::extension_action_test_util::CreateActionExtension( |
| 58 "no_action_extension", | 59 "no_action_extension", |
| 59 extensions::extension_action_test_util::NO_ACTION, | 60 extensions::extension_action_test_util::NO_ACTION, |
| 60 extensions::Manifest::UNPACKED); | 61 extensions::Manifest::UNPACKED); |
| 62 LOG(WARNING) << "Adding"; |
| 61 extension_service()->AddExtension(no_action_extension.get()); | 63 extension_service()->AddExtension(no_action_extension.get()); |
| 62 | 64 base::RunLoop().RunUntilIdle(); |
| 65 LOG(WARNING) << "Added"; |
| 66 LOG(WARNING) << "Work"; |
| 63 Browser* second_browser = new Browser(Browser::CreateParams(profile())); | 67 Browser* second_browser = new Browser(Browser::CreateParams(profile())); |
| 64 base::RunLoop().RunUntilIdle(); | 68 base::RunLoop().RunUntilIdle(); |
| 65 | 69 LOG(WARNING) << "Check"; |
| 66 CheckBubble(second_browser, ANCHOR_APP_MENU); | 70 CheckBubble(second_browser, ANCHOR_APP_MENU); |
| 67 CloseBubble(second_browser); | 71 CloseBubble(second_browser); |
| 72 LOG(WARNING) << "Done"; |
| 68 } | 73 } |
| 69 | 74 |
| 70 void ExtensionMessageBubbleBrowserTest:: | 75 void ExtensionMessageBubbleBrowserTest:: |
| 71 TestBubbleAnchoredToAppMenuWithOtherAction() { | 76 TestBubbleAnchoredToAppMenuWithOtherAction() { |
| 72 scoped_refptr<const extensions::Extension> no_action_extension = | 77 scoped_refptr<const extensions::Extension> no_action_extension = |
| 73 extensions::extension_action_test_util::CreateActionExtension( | 78 extensions::extension_action_test_util::CreateActionExtension( |
| 74 "no_action_extension", | 79 "no_action_extension", |
| 75 extensions::extension_action_test_util::NO_ACTION, | 80 extensions::extension_action_test_util::NO_ACTION, |
| 76 extensions::Manifest::UNPACKED); | 81 extensions::Manifest::UNPACKED); |
| 77 extension_service()->AddExtension(no_action_extension.get()); | 82 extension_service()->AddExtension(no_action_extension.get()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 120 |
| 116 void ExtensionMessageBubbleBrowserTest::PreBubbleShowsOnStartup() { | 121 void ExtensionMessageBubbleBrowserTest::PreBubbleShowsOnStartup() { |
| 117 LoadExtension(test_data_dir_.AppendASCII("good_unpacked")); | 122 LoadExtension(test_data_dir_.AppendASCII("good_unpacked")); |
| 118 } | 123 } |
| 119 | 124 |
| 120 void ExtensionMessageBubbleBrowserTest::TestBubbleShowsOnStartup() { | 125 void ExtensionMessageBubbleBrowserTest::TestBubbleShowsOnStartup() { |
| 121 base::RunLoop().RunUntilIdle(); | 126 base::RunLoop().RunUntilIdle(); |
| 122 CheckBubble(browser(), ANCHOR_BROWSER_ACTION); | 127 CheckBubble(browser(), ANCHOR_BROWSER_ACTION); |
| 123 CloseBubble(browser()); | 128 CloseBubble(browser()); |
| 124 } | 129 } |
| OLD | NEW |