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