ltilve / chromium

Chromium.org open source browser project, git cloned from http://git.chromium.org/chromium/src.git
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Having different extensions on the sidebar tests #38

Open ltilve opened 9 years ago

ltilve commented 9 years ago

By the comments from Devlin https://codereview.chromium.org/1168383002/#msg20

What about testing multiple extensions with sidebars?

Also review if we can manage to have the tests running inside of unittests instead of the browser ones

ltilve commented 9 years ago

There are still some problems by turning the browsertest to BrowserWithTestWindowTest browser_action_testutil Using the approach of existing unittest at e7f7bed

[ RUN ] SidebarTest.CreateSidebar Received signal 11 000000000000

0 0x000002600efe base::debug::StackTrace::StackTrace()

1 0x00000260139b base::debug::(anonymous namespace)::StackDumpSignalHandler()

2 0x7fbf03d638d0

3 0x000002208940 (anonymous namespace)::GetContainer()

4 0x000002208a99 BrowserActionTestUtil::GetToolbarActionsBar()

5 0x000000fea709 extensions::SidebarTest_CreateSidebar_Test::TestBody()

6 0x0000021d1902 testing::Test::Run()

7 0x0000021d1ac8 testing::TestInfo::Run()

8 0x0000021d1c1d testing::TestCase::Run()

9 0x0000021d2d35 testing::internal::UnitTestImpl::RunAllTests()

10 0x0000021d2f55 testing::UnitTest::Run()

11 0x000005452b65 base::TestSuite::Run()

12 0x00000544faec base::(anonymous namespace)::LaunchUnitTestsInternal()

13 0x00000544ffb6 base::LaunchUnitTests()

14 0x0000004f8247 main

15 0x7fbf0245fb45 __libc_start_main

16 0x0000004f94e7

ltilve commented 9 years ago

Now the browsertests are also checking the proper behaviour with several extensions df0dcfe284bff82562972a2503408827b9347016 Apart from other issues with the unittests and BrowserWithTestWindowTest, it seems that the cause for is_showing_popup failing(), even for the case of creating the extension and setting open_in_popup:true, is because the created extension was failing to have a proper default_popup.

ltilve commented 9 years ago

Having now again all the checks done using unittests seems to have some problems, as we were creating manually the sidebar using the CreateSidebar(browser()->tab_strip_model()->GetActiveWebContents()) of the former sidebarManager. As we don't have it any more, ExtensionActionViewController::ExecuteAction returns ExtensionAction::ACTION_NONE due to !(web_contents) so no latter TriggerSidebar|PopupWithUrl is called.

ltilve commented 9 years ago

The unittest that are not using sidebar_manager are at https://github.com/ltilve/chromium/commit/3fe7d25f4657ae53c86fc80785e345dfc0878977