| 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" | 8 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" |
| 9 #include "chrome/browser/extensions/extension_function_test_utils.h" | 9 #include "chrome/browser/extensions/extension_function_test_utils.h" |
| 10 #include "chrome/browser/extensions/extension_message_bubble.h" | 10 #include "chrome/browser/extensions/extension_message_bubble.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 TEST_F(ExtensionMessageBubbleTest, MAYBE_WipeoutControllerTest) { | 248 TEST_F(ExtensionMessageBubbleTest, MAYBE_WipeoutControllerTest) { |
| 249 // The test base class adds three extensions, and we control two of them in | 249 // The test base class adds three extensions, and we control two of them in |
| 250 // this test (ids are: extension_id1_ and extension_id2_). | 250 // this test (ids are: extension_id1_ and extension_id2_). |
| 251 scoped_ptr<TestSuspiciousExtensionBubbleController> controller( | 251 scoped_ptr<TestSuspiciousExtensionBubbleController> controller( |
| 252 new TestSuspiciousExtensionBubbleController(profile())); | 252 new TestSuspiciousExtensionBubbleController(profile())); |
| 253 FakeExtensionMessageBubble bubble; | 253 FakeExtensionMessageBubble bubble; |
| 254 bubble.set_action_on_show( | 254 bubble.set_action_on_show( |
| 255 FakeExtensionMessageBubble::BUBBLE_ACTION_CLICK_DISMISS_BUTTON); | 255 FakeExtensionMessageBubble::BUBBLE_ACTION_CLICK_DISMISS_BUTTON); |
| 256 | 256 |
| 257 // Validate that we don't have a suppress value for the extensions. | 257 // Validate that we don't have a suppress value for the extensions. |
| 258 ExtensionPrefs* prefs = service_->extension_prefs(); | 258 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile()); |
| 259 EXPECT_FALSE(prefs->HasWipeoutBeenAcknowledged(extension_id1_)); | 259 EXPECT_FALSE(prefs->HasWipeoutBeenAcknowledged(extension_id1_)); |
| 260 EXPECT_FALSE(prefs->HasWipeoutBeenAcknowledged(extension_id2_)); | 260 EXPECT_FALSE(prefs->HasWipeoutBeenAcknowledged(extension_id2_)); |
| 261 | 261 |
| 262 EXPECT_FALSE(controller->ShouldShow()); | 262 EXPECT_FALSE(controller->ShouldShow()); |
| 263 std::vector<base::string16> suspicious_extensions = | 263 std::vector<base::string16> suspicious_extensions = |
| 264 controller->GetExtensionList(); | 264 controller->GetExtensionList(); |
| 265 EXPECT_EQ(0U, suspicious_extensions.size()); | 265 EXPECT_EQ(0U, suspicious_extensions.size()); |
| 266 EXPECT_EQ(0U, controller->link_click_count()); | 266 EXPECT_EQ(0U, controller->link_click_count()); |
| 267 EXPECT_EQ(0U, controller->dismiss_click_count()); | 267 EXPECT_EQ(0U, controller->dismiss_click_count()); |
| 268 | 268 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 | 390 |
| 391 controller.reset(new TestDevModeBubbleController( | 391 controller.reset(new TestDevModeBubbleController( |
| 392 profile())); | 392 profile())); |
| 393 DevModeBubbleController::ClearProfileListForTesting(); | 393 DevModeBubbleController::ClearProfileListForTesting(); |
| 394 EXPECT_FALSE(controller->ShouldShow()); | 394 EXPECT_FALSE(controller->ShouldShow()); |
| 395 dev_mode_extensions = controller->GetExtensionList(); | 395 dev_mode_extensions = controller->GetExtensionList(); |
| 396 EXPECT_EQ(0U, dev_mode_extensions.size()); | 396 EXPECT_EQ(0U, dev_mode_extensions.size()); |
| 397 } | 397 } |
| 398 | 398 |
| 399 } // namespace extensions | 399 } // namespace extensions |
| OLD | NEW |