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 <algorithm> | 5 #include <algorithm> |
6 #include <iterator> | 6 #include <iterator> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 | 455 |
456 webkit_glue::WebIntentData intent; | 456 webkit_glue::WebIntentData intent; |
457 intent.action = kAction1; | 457 intent.action = kAction1; |
458 intent.type = kType2; | 458 intent.type = kType2; |
459 IntentsDispatcherMock dispatcher(intent); | 459 IntentsDispatcherMock dispatcher(intent); |
460 controller_->SetIntentsDispatcher(&dispatcher); | 460 controller_->SetIntentsDispatcher(&dispatcher); |
461 | 461 |
462 OnExtensionInstallRequested(extension_id); | 462 OnExtensionInstallRequested(extension_id); |
463 picker_.Wait(); | 463 picker_.Wait(); |
464 EXPECT_EQ(1, picker_.num_extensions_installed_); | 464 EXPECT_EQ(1, picker_.num_extensions_installed_); |
465 const Extension* extension = browser()->profile()->GetExtensionService()-> | 465 const extensions::Extension* extension = browser()->profile()-> |
466 GetExtensionById(extension_id, false); | 466 GetExtensionService()->GetExtensionById(extension_id, false); |
467 EXPECT_TRUE(extension); | 467 EXPECT_TRUE(extension); |
468 | 468 |
469 // Installing an extension should also choose it. Since this extension uses | 469 // Installing an extension should also choose it. Since this extension uses |
470 // window disposition, it will create a new tab. | 470 // window disposition, it will create a new tab. |
471 ASSERT_EQ(2, browser()->tab_count()); | 471 ASSERT_EQ(2, browser()->tab_count()); |
472 } | 472 } |
473 | 473 |
474 // Test that an explicit intent does not trigger loading intents from the | 474 // Test that an explicit intent does not trigger loading intents from the |
475 // registry (skips the picker), and creates the intent service handler | 475 // registry (skips the picker), and creates the intent service handler |
476 // immediately. | 476 // immediately. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 592 |
593 EXPECT_EQ(2, picker_.num_installed_services_); | 593 EXPECT_EQ(2, picker_.num_installed_services_); |
594 | 594 |
595 // The tab is shown immediately without needing to call OnServiceChosen. | 595 // The tab is shown immediately without needing to call OnServiceChosen. |
596 ASSERT_EQ(2, browser()->tab_count()); | 596 ASSERT_EQ(2, browser()->tab_count()); |
597 EXPECT_EQ(GURL(kServiceURL1), | 597 EXPECT_EQ(GURL(kServiceURL1), |
598 browser()->GetSelectedWebContents()->GetURL()); | 598 browser()->GetSelectedWebContents()->GetURL()); |
599 | 599 |
600 EXPECT_TRUE(dispatcher.dispatched_); | 600 EXPECT_TRUE(dispatcher.dispatched_); |
601 } | 601 } |
OLD | NEW |