| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser.h" | 5 #include "chrome/browser/browser.h" |
| 6 #include "chrome/browser/extensions/extension_browsertest.h" | 6 #include "chrome/browser/extensions/extension_browsertest.h" |
| 7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
| 8 #include "chrome/browser/extensions/extension_shelf_model.h" | 8 #include "chrome/browser/extensions/extension_shelf_model.h" |
| 9 #include "chrome/browser/extensions/extensions_service.h" | 9 #include "chrome/browser/extensions/extensions_service.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 IN_PROC_BROWSER_TEST_F(ExtensionShelfModelTest, Basic) { | 75 IN_PROC_BROWSER_TEST_F(ExtensionShelfModelTest, Basic) { |
| 76 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("good") | 76 ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("good") |
| 77 .AppendASCII("Extensions") | 77 .AppendASCII("Extensions") |
| 78 .AppendASCII(kExtensionId) | 78 .AppendASCII(kExtensionId) |
| 79 .AppendASCII("1.0.0.0"))); | 79 .AppendASCII("1.0.0.0"))); |
| 80 | 80 |
| 81 // extension1 has two toolstrips | 81 // extension1 has two toolstrips |
| 82 EXPECT_EQ(inserted_count_, 2); | 82 EXPECT_EQ(inserted_count_, 2); |
| 83 ExtensionHost* one = model_->ToolstripAt(0); | 83 ExtensionHost* one = model_->ToolstripAt(0).host; |
| 84 ExtensionHost* two = model_->ToolstripAt(1); | 84 ExtensionHost* two = model_->ToolstripAt(1).host; |
| 85 EXPECT_EQ(one->GetURL().path(), "/toolstrip1.html"); | 85 EXPECT_EQ(one->GetURL().path(), "/toolstrip1.html"); |
| 86 EXPECT_EQ(two->GetURL().path(), "/toolstrip2.html"); | 86 EXPECT_EQ(two->GetURL().path(), "/toolstrip2.html"); |
| 87 | 87 |
| 88 model_->MoveToolstripAt(0, 1); | 88 model_->MoveToolstripAt(0, 1); |
| 89 EXPECT_EQ(two, model_->ToolstripAt(0)); | 89 EXPECT_EQ(two, model_->ToolstripAt(0).host); |
| 90 EXPECT_EQ(one, model_->ToolstripAt(1)); | 90 EXPECT_EQ(one, model_->ToolstripAt(1).host); |
| 91 EXPECT_EQ(moved_count_, 1); | 91 EXPECT_EQ(moved_count_, 1); |
| 92 | 92 |
| 93 model_->RemoveToolstripAt(0); | 93 model_->RemoveToolstripAt(0); |
| 94 EXPECT_EQ(one, model_->ToolstripAt(0)); | 94 EXPECT_EQ(one, model_->ToolstripAt(0).host); |
| 95 EXPECT_EQ(1, model_->count()); | 95 EXPECT_EQ(1, model_->count()); |
| 96 EXPECT_EQ(removed_count_, 1); | 96 EXPECT_EQ(removed_count_, 1); |
| 97 } | 97 } |
| OLD | NEW |