tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TestNoPrincipalGetUri.cpp (768B)


      1 class nsIPrincipal {
      2 public:
      3  void GetURI(int foo){};
      4 };
      5 
      6 class SomePrincipal : public nsIPrincipal {
      7 public:
      8  void GetURI(int foo) {}
      9 };
     10 
     11 class NullPrincipal : public SomePrincipal {};
     12 
     13 class SomeURI {
     14 public:
     15  void GetURI(int foo) {}
     16 };
     17 
     18 void f() {
     19  nsIPrincipal *a = new SomePrincipal();
     20  a->GetURI(0); //  expected-error {{Principal->GetURI is deprecated and will be removed soon. Please consider using the new helper functions of nsIPrincipal}}
     21 
     22  ::nsIPrincipal *b = new NullPrincipal();
     23  b->GetURI(0); //  expected-error {{Principal->GetURI is deprecated and will be removed soon. Please consider using the new helper functions of nsIPrincipal}}
     24 
     25  SomeURI *c = new SomeURI();
     26  c->GetURI(0);
     27 
     28  SomePrincipal *d = new SomePrincipal();
     29  d->GetURI(0);
     30 
     31 }