OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file tests that Service Workers (a Content feature) work in the Chromium | 5 // This file tests that Service Workers (a Content feature) work in the Chromium |
6 // embedder. | 6 // embedder. |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 const base::string16 expected_title2 = base::ASCIIToUTF16("Done"); | 584 const base::string16 expected_title2 = base::ASCIIToUTF16("Done"); |
585 content::TitleWatcher title_watcher2( | 585 content::TitleWatcher title_watcher2( |
586 browser()->tab_strip_model()->GetActiveWebContents(), expected_title2); | 586 browser()->tab_strip_model()->GetActiveWebContents(), expected_title2); |
587 | 587 |
588 histogram_tester_.ExpectTotalCount( | 588 histogram_tester_.ExpectTotalCount( |
589 "ServiceWorker.StartWorker.StatusByPurpose_NAVIGATION_HINT_LINK_MOUSE_" | 589 "ServiceWorker.StartWorker.StatusByPurpose_NAVIGATION_HINT_LINK_MOUSE_" |
590 "DOWN", | 590 "DOWN", |
591 0); | 591 0); |
592 content::SimulateMouseClickAt( | 592 content::SimulateMouseClickAt( |
593 browser()->tab_strip_model()->GetActiveWebContents(), 0, | 593 browser()->tab_strip_model()->GetActiveWebContents(), 0, |
594 blink::WebMouseEvent::ButtonLeft, gfx::Point(0, 0)); | 594 blink::WebMouseEvent::Button::Left, gfx::Point(0, 0)); |
595 EXPECT_EQ(expected_title2, title_watcher2.WaitAndGetTitle()); | 595 EXPECT_EQ(expected_title2, title_watcher2.WaitAndGetTitle()); |
596 | 596 |
597 // The service worker must be started by a navigation hint. | 597 // The service worker must be started by a navigation hint. |
598 histogram_tester_.ExpectBucketCount( | 598 histogram_tester_.ExpectBucketCount( |
599 "ServiceWorker.StartWorker.StatusByPurpose_NAVIGATION_HINT_LINK_MOUSE_" | 599 "ServiceWorker.StartWorker.StatusByPurpose_NAVIGATION_HINT_LINK_MOUSE_" |
600 "DOWN", | 600 "DOWN", |
601 0 /* SERVICE_WORKER_OK */, 1); | 601 0 /* SERVICE_WORKER_OK */, 1); |
602 } | 602 } |
603 | 603 |
604 } // namespace | 604 } // namespace |
OLD | NEW |