summaryrefslogtreecommitdiffstats
path: root/chrome/browser/importer/toolbar_importer_utils_browsertest.cc
blob: 999dbf1ce4b51efc8c3dcefb518200892eba6c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/bind.h"
#include "base/message_loop.h"
#include "chrome/browser/importer/toolbar_importer_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"

namespace {

class ToolbarImporterUtilsTest : public InProcessBrowserTest {
 public:
  ToolbarImporterUtilsTest() : did_run_(false) {
  }

  void Callback(bool result) {
    DCHECK(!result);
    did_run_ = true;
    MessageLoop::current()->Quit();
  }

 protected:
  bool did_run_;
};

IN_PROC_BROWSER_TEST_F(ToolbarImporterUtilsTest, NoCrash) {
  // Regression test for http://crbug.com/89752
  toolbar_importer_utils::IsGoogleGAIACookieInstalled(
      base::Bind(&ToolbarImporterUtilsTest::Callback,
                 base::Unretained(this)),
      browser()->profile());
  if (!did_run_) {
    content::RunMessageLoop();
  }
  ASSERT_TRUE(did_run_);
}

}  // namespace