Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1144)

Side by Side Diff: chrome/browser/rlz/chrome_rlz_tracker_delegate_unittest.cc

Issue 1229933005: Revert "Componentize chrome/browser/rlz" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/rlz/chrome_rlz_tracker_delegate.cc ('k') | chrome/browser/rlz/rlz.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h"
6
7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/chrome_notification_types.h"
9 #include "content/public/browser/navigation_details.h"
10 #include "content/public/browser/navigation_entry.h"
11 #include "content/public/browser/notification_service.h"
12 #include "content/public/browser/notification_source.h"
13 #include "testing/gtest/include/gtest/gtest.h"
14
15 using content::NavigationEntry;
16 using content::LoadCommittedDetails;
17
18 class ChromeRLZTrackerDelegateTest : public testing::Test {
19 public:
20 ChromeRLZTrackerDelegateTest() : delegate_(new ChromeRLZTrackerDelegate) {}
21 ~ChromeRLZTrackerDelegateTest() override {}
22
23 void SendNotification(int type,
24 const content::NotificationSource& source,
25 const content::NotificationDetails& details) {
26 content::NotificationObserver* observer = delegate_.get();
27 observer->Observe(type, source, details);
28 }
29
30 private:
31 scoped_ptr<ChromeRLZTrackerDelegate> delegate_;
32 };
33
34 TEST_F(ChromeRLZTrackerDelegateTest, ObserveHandlesBadArgs) {
35 scoped_ptr<content::LoadCommittedDetails> details(
36 new content::LoadCommittedDetails());
37 scoped_ptr<content::NavigationEntry> entry(
38 content::NavigationEntry::Create());
39 details->entry = entry.get();
40 details->entry->SetPageID(0);
41 details->entry->SetTransitionType(ui::PAGE_TRANSITION_LINK);
42 SendNotification(content::NOTIFICATION_NAV_ENTRY_COMMITTED,
43 content::NotificationService::AllSources(),
44 content::Details<NavigationEntry>(nullptr));
45 SendNotification(content::NOTIFICATION_NAV_ENTRY_COMMITTED,
46 content::NotificationService::AllSources(),
47 content::Details<LoadCommittedDetails>(details.get()));
48 }
OLDNEW
« no previous file with comments | « chrome/browser/rlz/chrome_rlz_tracker_delegate.cc ('k') | chrome/browser/rlz/rlz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698