| 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/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/extensions/extension_action_test_util.h" | 10 #include "chrome/browser/extensions/extension_action_test_util.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 "{\n" | 60 "{\n" |
| 61 " 'name': 'settings override',\n" | 61 " 'name': 'settings override',\n" |
| 62 " 'version': '0.1',\n" | 62 " 'version': '0.1',\n" |
| 63 " 'manifest_version': 2,\n" | 63 " 'manifest_version': 2,\n" |
| 64 " 'description': 'controls settings',\n" | 64 " 'description': 'controls settings',\n" |
| 65 " 'chrome_settings_overrides': {\n" | 65 " 'chrome_settings_overrides': {\n" |
| 66 " %s\n" | 66 " %s\n" |
| 67 " }\n" | 67 " }\n" |
| 68 "}", settings_override_value.c_str()); | 68 "}", settings_override_value.c_str()); |
| 69 custom_extension_dir_->WriteManifestWithSingleQuotes(manifest); | 69 custom_extension_dir_->WriteManifestWithSingleQuotes(manifest); |
| 70 ASSERT_TRUE(LoadExtension(custom_extension_dir_->unpacked_path())); | 70 ASSERT_TRUE(LoadExtension(custom_extension_dir_->UnpackedPath())); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void ExtensionMessageBubbleBrowserTest::CheckBubble( | 73 void ExtensionMessageBubbleBrowserTest::CheckBubble( |
| 74 Browser* browser, | 74 Browser* browser, |
| 75 AnchorPosition position, | 75 AnchorPosition position, |
| 76 bool should_be_highlighting) { | 76 bool should_be_highlighting) { |
| 77 EXPECT_EQ(should_be_highlighting, toolbar_model()->is_highlighting()); | 77 EXPECT_EQ(should_be_highlighting, toolbar_model()->is_highlighting()); |
| 78 EXPECT_TRUE(toolbar_model()->has_active_bubble()); | 78 EXPECT_TRUE(toolbar_model()->has_active_bubble()); |
| 79 EXPECT_TRUE(browser->window()->GetToolbarActionsBar()->is_showing_bubble()); | 79 EXPECT_TRUE(browser->window()->GetToolbarActionsBar()->is_showing_bubble()); |
| 80 CheckBubbleNative(browser, position); | 80 CheckBubbleNative(browser, position); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 Browser* second_browser = new Browser(Browser::CreateParams(profile())); | 319 Browser* second_browser = new Browser(Browser::CreateParams(profile())); |
| 320 base::RunLoop().RunUntilIdle(); | 320 base::RunLoop().RunUntilIdle(); |
| 321 CheckBubble(second_browser, ANCHOR_BROWSER_ACTION, true); | 321 CheckBubble(second_browser, ANCHOR_BROWSER_ACTION, true); |
| 322 ClickDismissButton(second_browser); | 322 ClickDismissButton(second_browser); |
| 323 base::RunLoop().RunUntilIdle(); | 323 base::RunLoop().RunUntilIdle(); |
| 324 CheckBubbleIsNotPresent(browser(), false, false); | 324 CheckBubbleIsNotPresent(browser(), false, false); |
| 325 // Clicking dismiss should have no affect, so the extension should still be | 325 // Clicking dismiss should have no affect, so the extension should still be |
| 326 // active. | 326 // active. |
| 327 EXPECT_TRUE(registry->enabled_extensions().GetByID(id)); | 327 EXPECT_TRUE(registry->enabled_extensions().GetByID(id)); |
| 328 } | 328 } |
| OLD | NEW |